Handy helper class to generate and manipulate filter arrays containing children.

This class is intended to be only used as base class of other filters and via the FilterBuilder main class.

 Methods

{@inheritdoc}

__clone() 

Create a new instance.

__construct(array $children) 

Parameters

$children

array

The initial children to absorb.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When invalid children have been passed.

Add a given filter builder to this instance.

add(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\BaseFilterBuilder $filter) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\FilterBuilderWithChildren

Absorb the given filter builder or filter builder collection.

append(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder|\ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\FilterBuilderWithChildren $filters) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\FilterBuilderWithChildren

Initialize an instance with the values from the given array.

fromArray(array $array, \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder $builder) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\BaseFilterBuilder
Static

{@inheritDoc}

get() 

Get the position index of a given filter builder in this instance.

indexOf(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\BaseFilterBuilder $filter) : int

Return the key of the current element.

key() : mixed

Returns

mixedscalar on success, or null on failure.

Whether a offset exists.

offsetExists(int $offset) : boolean

Parameters

$offset

int

An offset to check for.

Returns

booleantrue on success or false on failure.

Set the element at a certain offset.

offsetSet(mixed $offset, mixed $value) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\FilterBuilderWithChildren

Parameters

$offset

mixed

The offset to assign the value to.

$value

mixed

The value to set.

Returns

Remove a given filter builder from this instance.

remove(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\BaseFilterBuilder $filter) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\FilterBuilderWithChildren

Rewind the Iterator to the first element and return it.

rewind() : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\FilterBuilder\BaseFilterBuilder
This is an alias for {@link FilterBuilderWithChildren::first()} only present for implementing Iterator interface.

Returns

{@inheritDoc}

setBuilder($builder) 

Parameters

$builder

Checks if current position is valid.

valid() : boolean

Returns

booleanReturns true on success or false on failure.

 Properties

   

The current index.

$index : int
 

The operation string.

$operation : string