692. Class

692.1. Zend\Filter\FilterChain

692.1.1. Methods

692.1.1.1. __construct

__construct()

Initialize filter chain

692.1.1.2. setOptions

setOptions()

692.1.1.3. count

count()

Return the count of attached filters

Return type:int

692.1.1.4. getPluginManager

getPluginManager()

Get plugin manager instance

Return type:FilterPluginManager

692.1.1.5. setPluginManager

setPluginManager()

Set plugin manager instance

Parameters:FilterPluginManager
Return type:FilterChain

692.1.1.6. plugin

plugin()

Retrieve a filter plugin by name

Parameters:
  • mixed
  • array
Return type:

FilterInterface

692.1.1.7. attach

attach()

Attach a filter to the chain

Parameters:
  • callable|FilterInterface – A Filter implementation or valid PHP callback
  • int – Priority at which to enqueue filter; defaults to 1000 (higher executes earlier)
Throws ExceptionInvalidArgumentException:
 
Return type:

FilterChain

692.1.1.8. attachByName

attachByName()

Attach a filter to the chain using a short name

Retrieves the filter from the attached plugin manager, and then calls attach() with the retrieved instance.

Parameters:
  • string
  • mixed
  • int – Priority at which to enqueue filter; defaults to 1000 (higher executes earlier)
Return type:

FilterChain

692.1.1.9. merge

merge()

Merge the filter chain with the one given in parameter

Parameters:FilterChain
Return type:FilterChain

692.1.1.10. getFilters

getFilters()

Get all the filters

Return type:PriorityQueue

692.1.1.11. filter

filter()

Returns $value filtered through each filter in the chain

Filters are run in the order in which they were added to the chain (FIFO)

Parameters:mixed
Return type:mixed

692.1.1.12. __clone

__clone()

Clone filters

692.1.1.13. __sleep

__sleep()

Prepare filter chain for serialization

Plugin manager (property ‘plugins’) cannot be serialized. On wakeup the property remains unset and next invokation to getPluginManager() sets the default plugin manager instance (FilterPluginManager).

692.1.2. Constants

692.1.2.1. DEFAULT_PRIORITY

Default priority at which filters are added