Zend\Stdlib\Hydrator\Filter\FilterComposite::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>
Signature
public function addFilter(string
$name,
[callable|FilterInterface
$filter = self::CONDITION_OR,
[int
$condition = self::CONDITION_OR]] )
Parameters
$name
— string$filter
— object
$condition
— int- Can be either FilterComposite::CONDITION_OR or FilterComposite::CONDITION_AND
Returns
- FilterComposite