This interface holds the information how a parent model relates to a child model.

 Methods

Apply a condition to a child.

applyTo(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objParent, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objChild) : void

Parameters

$objChild

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The object on which the condition shall be enforced on.

Apply a condition to a child by copying it from another child.

copyFrom(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $sourceModel, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $destinationModel) : void

Parameters

$destinationModel

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model on which the condition shall be enforced on.

Return the name of the destination provider.

getDestinationName() : string

Returns

string

Get the condition as filter related to the given model.

getFilter(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objParent) : array

Parameters

$objParent

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model that shall get used as parent.

Returns

array

Get the condition as filter.

getFilterArray() : array

Returns

array

Get the inverse filter for the condition.

getInverseFilterArray() : array

Returns

array

Get the inverted condition as filter.

getInverseFilterFor(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objChild) : array | null
This allows to look up the parent of a child model.

Parameters

$objChild

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model that shall get used as child and for which the parent filter shall get retrieved.

Returns

arraynull

Get the condition setters.

getSetters() : array

Returns

array

Return the name of the source provider (parent).

getSourceName() : string

Returns

string

Test if the given parent is indeed a parent of the given child object for this condition.

matches(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objParent, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objChild) : bool

Parameters

Returns

bool

Return the names of the needed properties for filtering.

neededProperties() : array

Returns

array

Set the name of the destination provider (child).

setDestinationName(string $value) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\ParentChildConditionInterface

Set the condition as filter.

setFilterArray(array $value) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\ParentChildConditionInterface

Parameters

$value

array

The filter rules describing the relationship.

Returns

Set the inverse filter for the condition.

setInverseFilterArray(array $value) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\ParentChildConditionInterface

Parameters

$value

array

The filter rules to use when inverting the condition to look up the parent.

Returns

Set the condition setters.

setSetters(array $value) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\ParentChildConditionInterface

Parameters

$value

array

The values to be applied to a model when it shall get set as child of another one.

Returns

Set the name of the source provider.

setSourceName(string $value) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\ParentChildConditionInterface