package Default
inherited_from \Zend\Stdlib\Hydrator\Filter\FilterProviderInterface

 Methods

Add a new filter to take care of what needs to be hydrated.

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

To exclude e.g. the method getServiceLocator:

$composite->addFilter( "servicelocator", function ($property) { list($class, $method) = explode('::', $property); if ($method === 'getServiceLocator') { return false; } return true; }, FilterComposite::CONDITION_AND );

Parameters

$name

string

Index in the composite

$filter

callable\Zend\Stdlib\Hydrator\Filter\FilterInterface

$condition

integer

Returns

\Zend\Stdlib\Hydrator\Filter\FilterComposite

Check whether a specific filter exists at key $name or not

hasFilter(string $name) : boolean

Parameters

$name

string

Index in the composite

Returns

boolean

Remove a filter from the composition.

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

To not extract "has" methods, you simply need to unregister it

$filterComposite->removeFilter('has');

Parameters

$name

Returns

\Zend\Stdlib\Hydrator\Filter\FilterComposite