Fully Qualified Name: | Laminas\Hydrator\Filter\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|\FilterInterface | |
$condition |
Returns:
Provides a filter for hydration
Returns:
Check whether a specific filter exists at key $name or not
Parameter Name | Type | Description |
---|---|---|
$name | string | Index |
Returns:
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 |
Returns: