Zend Framework  3.0
Public Member Functions | List of all members
FilterEnabledInterface Interface Reference

Public Member Functions

 addFilter ($name, $filter, $condition=Filter\FilterComposite::CONDITION_OR)
 Add a new filter to take care of what needs to be hydrated.
 
 hasFilter ($name)
 Check whether a specific filter exists at key $name or not.
 
 removeFilter ($name)
 Remove a filter from the composition.
 
- Public Member Functions inherited from FilterProviderInterface
 getFilter ()
 Provides a filter for hydration.
 

Member Function Documentation

addFilter (   $name,
  $filter,
  $condition = Filter\FilterComposite::CONDITION_OR 
)

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 );

Parameters
string$nameIndex in the composite
callable | Filter\FilterInterface$filter
int$condition
Returns
Filter

Implemented in ClassMethods, and AbstractHydrator.

hasFilter (   $name)

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

Parameters
string$nameIndex in the composite
Returns
bool

Implemented in AbstractHydrator.

removeFilter (   $name)

Remove a filter from the composition.

To not extract "has" methods, you simply need to unregister it

$filterComposite->removeFilter('has');

Parameters
$name
Returns
Filter

Implemented in AbstractHydrator, and ClassMethods.