Default implementation of a parent child relationship.

It implements a basic condition check.

 Methods

{@inheritdoc}

applyTo($objParent, $objChild) 

Parameters

$objParent

$objChild

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException For invalid setters.

{@inheritdoc}

copyFrom($sourceModel, $destinationModel) 

Parameters

$sourceModel

$destinationModel

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException For invalid setters.

{@inheritdoc}

getDestinationName() 

{@inheritdoc}

getFilter($objParent) 

Parameters

$objParent

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException when an empty parent model is given.

{@inheritdoc}

getFilterArray() 

{@inheritdoc}

getInverseFilterArray() 

{@inheritdoc}

getInverseFilterFor($objChild) 

Parameters

$objChild

{@inheritdoc}

getSetters() 

{@inheritdoc}

getSourceName() 

{@inheritdoc}

matches($objParent, $objChild) 

Parameters

$objParent

$objChild

{@inheritdoc}

neededProperties() 

Apply the filter values for a given model to the given rule.

parseFilter(array $filter, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) : array

Parameters

$filter

array

The filter rule to which the values shall get applied.

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model to fetch the values from.

Returns

array

{@inheritdoc}

setDestinationName($value) 

Parameters

$value

{@inheritdoc}

setFilterArray($value) 

Parameters

$value

{@inheritdoc}

setInverseFilterArray($value) 

Parameters

$value

{@inheritdoc}

setSetters($value) 

Parameters

$value

{@inheritdoc}

setSourceName($value) 

Parameters

$value

Prepare a filter rule to be checked via checkCondition().

prepareRule(array $rule, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $child) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\array.

Return the names of the needed properties for filtering.

extractNeededProperties(array $rule) : array

Parameters

$rule

array

The filter rule from which the properties shall be extracted from.

Exceptions

\RuntimeException When an unexpected filter rule is encountered.

Returns

array

Check if the passed value is a valid setter.

isValidSetter(array $setter) : bool

Parameters

$setter

array

The setter.

Returns

bool

 Properties

 

The name of the destination provider (child).

$destinationProvider : string
 

The filter rules.

$filter : array
 

The filter rules to use for an inverse filter.

$inverseFilter : array
 

The values to use when enforcing a root condition.

$setOn : array
 

The name of the source provider (parent).

$sourceProvider : string
 

Local cache property for the needed properties for filtering.

$neededProperties : array