Interface FilterEnabledInterface

Summary

Fully Qualified Name: Zend\Hydrator\FilterEnabledInterface
Extends: FilterProviderInterface

Description

Methods

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

Method Details

addFilter()

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

getFilter()

Provides a filter for hydration

Returns: \FilterInterface

hasFilter()

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

Parameter Name Type Description
$name string Index

Returns: bool

removeFilter()

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

Top