693. Class

693.1. Zend\Stdlib\Hydrator\Filter\FilterComposite

693.1.1. Methods

693.1.1.1. __construct

__construct()

Define default Filter

693.1.1.2. addFilter

addFilter()

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

This example will exclude all methods from the hydration, that starts with ‘getService’ <code> $composite->addFilter(‘exclude’,

function($method) {
if (preg_match(‘/^getService/’, $method) {
return false;

} return true;

}, FilterComposite::CONDITION_AND

); </code>

Parameters:
  • string
  • callable|FilterInterface
  • int – Can be either FilterComposite::CONDITION_OR or FilterComposite::CONDITION_AND
Throws InvalidArgumentException:
 
Return type:

FilterComposite

693.1.1.3. removeFilter

removeFilter()

Remove a filter from the composition

Parameters:$name – Identifier for the filter
Return type:FilterComposite

693.1.1.4. hasFilter

hasFilter()

Check if $name has a filter registered

Parameters:$name – Identifier for the filter
Return type:bool

693.1.1.5. filter

filter()

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

Parameters:$property – Parameter will be e.g. ParentNamespaceClass::method
Return type:bool

693.1.2. Constants

693.1.2.1. CONDITION_OR

Constant to add with “or” conditition

693.1.2.2. CONDITION_AND

Constant to add with “and” conditition