class \mpf\datasources\sql\RelationsParser

class \mpf\datasources\sql\RelationsParser

-no description found-

Attributes
public \mpf\datasources\sql\DbRelation[] $relations

-no description found-

public \mpf\datasources\sql\DbModel $modelClass

-no description found-

public \mpf\datasources\sql\ModelCondition $condition

-no description found-

public string[] $conditionColumns

-no description found-

protected array $conditionParams = []

-no description found-

protected array $toBeSelectedSeparately = []

It will keep here a list of names for relations that must be selected separately(from this level only).

protected \mpf\datasources\sql\DbRelation[] $selectedWithMainModel = []

List of relations that were selected with main model

Methods

public static \mpf\datasources\sql\RelationsParser parse (string $modelClass, \mpf\datasources\sql\ModelCondition $condition, string[] $conditionColumns)

  • $modelClass

    -no description found-

  • $condition

    -no description found-

  • $conditionColumns

    -no description found-

-no description found-

public mixed init (mixed $config)

  • $config

    -no description found-

-no description found-

protected bool existsInCondition (mixed $name)

  • $name

    -no description found-

Checks if condition depends on that relation or not. If it doesn't then there's no need for a join when counting.

public array getConditionParams ()

Get list of condition params;

public mixed getForCount ()

-no description found-

public string getForMainSelect ()

-no description found-

public \mpf\datasources\sql\DbRelation[] getListOfSelectedRelations ()

List of relations that are selected with main model;

protected \mpf\datasources\sql\DbRelation initSubRelation (mixed $path, \mpf\datasources\sql\DbRelation $parentRelation)

  • $path

    -no description found-

  • $parentRelation

    -no description found-

-no description found-

public bool hasSingleResult (mixed $name)

  • $name

    -no description found-

Checks if the relation returns a single result. It also checks for parents if it's a relation of a relation.

public mixed getRelationsToBeSelectedSeparately ()

-no description found-

public mixed getChildrenForModels (\mpf\datasources\sql\DbModel[] $models, string $relationPath, array $relationDetails, string $fields)

  • $models

    -no description found-

  • $relationPath

    -no description found-

  • $relationDetails

    -no description found-

  • $fields

    -no description found-

-no description found-

public \mpf\datasources\sql\DbModel[] getForSingleModel (\mpf\datasources\sql\DbModel $model, mixed $relationName)

  • $model

    -no description found-

  • $relationName

    -no description found-

-no description found-

protected array getFieldsForRelationPath (mixed $fields, mixed $relationPath)

  • $fields

    -no description found-

  • $relationPath

    -no description found-

Extracts only fields required for this relations

protected \mpf\datasources\sql\DbModel[] getAllChildsFromPath (\mpf\datasources\sql\DbModel[] $models, string $relationPath)

  • $models

    -no description found-

  • $relationPath

    -no description found-

Get list of all model childs from a selected path.