__construct()
addFilter()
filter()
hasFilter()
removeFilter()
$andFilter
$orFilter
CONDITION_AND
CONDITION_OR
__construct(array $orFilter, array $andFilter)
array
array
\Zend\Stdlib\Exception\InvalidArgumentException |
---|
addFilter(string $name, \Zend\Stdlib\Hydrator\Filter\callable | \Zend\Stdlib\Hydrator\Filter\FilterInterface $filter, int $condition) : \Zend\Stdlib\Hydrator\Filter\FilterComposite
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'
$composite->addFilter('exclude',
function ($method) {
if (preg_match('/^getService/', $method) {
return false;
}
return true;
}, FilterComposite::CONDITION_AND
);
string
\Zend\Stdlib\Hydrator\Filter\callable\Zend\Stdlib\Hydrator\Filter\FilterInterface
int
Can be either FilterComposite::CONDITION_OR or FilterComposite::CONDITION_AND
\Zend\Stdlib\Exception\InvalidArgumentException |
---|
filter(\Zend\Stdlib\Hydrator\Filter\$property $property) : bool
Otherwise false
\Zend\Stdlib\Hydrator\Filter\$property
string Parameter will be e.g. Parent\Namespace\Class::method
bool
hasFilter(\Zend\Stdlib\Hydrator\Filter\$name $name) : bool
\Zend\Stdlib\Hydrator\Filter\$name
string Identifier for the filter
bool
removeFilter(\Zend\Stdlib\Hydrator\Filter\$name $name) : \Zend\Stdlib\Hydrator\Filter\FilterComposite
\Zend\Stdlib\Hydrator\Filter\$name
string Identifier for the filter
CONDITION_AND
CONDITION_OR