Methods

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

addFilter(string $name, \Zend\Stdlib\Hydrator\callable | \Zend\Stdlib\Hydrator\Filter\FilterInterface $filter, int $condition) : \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

\Zend\Stdlib\Hydrator\callable\Zend\Stdlib\Hydrator\Filter\FilterInterface

$condition

int

Returns

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

hasFilter(string $name) : bool

Parameters

$name

string

Index in the composite

Returns

bool

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