Fully Qualified Name: | Zend\Hydrator\FilterEnabledInterface |
Extends: | FilterProviderInterface |
Name | Description | Defined By |
---|---|---|
addFilter() | Add a new filter to take care of what needs to be hydrated. | FilterEnabledInterface |
getFilter() | Provides a filter for hydration | FilterProviderInterface |
hasFilter() | Check whether a specific filter exists at key $name or not | FilterEnabledInterface |
removeFilter() | Remove a filter from the composition. | FilterEnabledInterface |
Add a new filter to take care of what needs to be hydrated.
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
);
Parameter Name | Type | Description |
---|---|---|
$name | string | Index |
$filter | callable|\Filter\FilterInterface | |
$condition | int |
Returns: \Filter\FilterComposite
Provides a filter for hydration
Returns: \FilterInterface
Check whether a specific filter exists at key $name or not
Parameter Name | Type | Description |
---|---|---|
$name | string | Index |
Returns: bool
Remove a filter from the composition.
To not extract "has" methods, you simply need to unregister it
$filterComposite->removeFilter('has');
Parameter Name | Type | Description |
---|---|---|
$name | ||
$name |
Returns: \Filter\FilterComposite