package Default

 Methods

Define default Filter

__construct(array $orFilter = array(), array $andFilter = array()

Parameters

$orFilter

array

$andFilter

array

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Add a filter to the composite. Has to be indexed with $name in order to identify a specific filter.

addFilter(string $name, callable|\Zend\Stdlib\Hydrator\Filter\FilterInterface $filter, integer $condition = self::CONDITION_OR) : \Zend\Stdlib\Hydrator\Filter\FilterComposite

This example will exclude all methods from the hydration, that starts with 'getService' $composite->addFilter('exclude', function ($method) { if (preg_match('/^getService/', $method) { return false; } return true; }, FilterComposite::CONDITION_AND );

Parameters

$name

string

$filter

callable\Zend\Stdlib\Hydrator\Filter\FilterInterface

$condition

integer

Can be either FilterComposite::CONDITION_OR or FilterComposite::CONDITION_AND

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Returns

\Zend\Stdlib\Hydrator\Filter\FilterComposite

Filter the composite based on the AND and OR condition Will return true if one from the "or conditions" and all from the "and condition" returns true. Otherwise false

filter(string $property) : boolean
inherited_from \Zend\Stdlib\Hydrator\Filter\FilterInterface::filter()

Parameters

$property

string Parameter will be e.g. Parent\Namespace\Class::method

Returns

boolean

Check if $name has a filter registered

hasFilter($name) : boolean

Parameters

$name

string Identifier for the filter

Returns

boolean

Remove a filter from the composition

removeFilter($name) : \Zend\Stdlib\Hydrator\Filter\FilterComposite

Parameters

$name

string Identifier for the filter

Returns

\Zend\Stdlib\Hydrator\Filter\FilterComposite

 Properties

 

$andFilter

$andFilter : \ArrayObject

Default

 

$orFilter

$orFilter : \ArrayObject

Default

 Constants

 

Constant to add with "and" conditition

CONDITION_AND = 2 
 

Constant to add with "or" conditition

CONDITION_OR = 1