Class FilterChain

Summary

Fully Qualified Name: Zend\Filter\FilterChain
Extends: AbstractFilter
Implements: Countable

Description

Methods

Name Description Defined By
__clone() Clone filters FilterChain
__construct() Initialize filter chain FilterChain
__invoke() Invoke filter as a command AbstractFilter
__sleep() Prepare filter chain for serialization FilterChain
attach() Attach a filter to the chain FilterChain
attachByName() Attach a filter to the chain using a short name FilterChain
count() Return the count of attached filters FilterChain
filter() Returns $value filtered through each filter in the chain FilterChain
getFilters() Get all the filters FilterChain
getOptions() Retrieve options representing object state AbstractFilter
getPluginManager() Get plugin manager instance FilterChain
hasPcreUnicodeSupport() AbstractFilter
merge() Merge the filter chain with the one given in parameter FilterChain
plugin() Retrieve a filter plugin by name FilterChain
setOptions() FilterChain
setPluginManager() Set plugin manager instance FilterChain

Method Details

__clone()

Clone filters

Returns:

__construct()

Initialize filter chain

Parameter Name Type Description
$options null|array|\Traversable

Returns:

__invoke()

Invoke filter as a command

Proxies to {@link filter()}

Parameter Name Type Description
$value mixed

Returns: mixed

__sleep()

Prepare filter chain for serialization

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

Returns:

attach()

Attach a filter to the chain

Parameter Name Type Description
$callback callable|\FilterInterface A
$priority int Priority

Returns: self

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.

Parameter Name Type Description
$name string
$options mixed
$priority int Priority

Returns: self

count()

Return the count of attached filters

Returns: int

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)

Parameter Name Type Description
$value mixed

Returns: mixed

getFilters()

Get all the filters

Returns: \PriorityQueue

getOptions()

Retrieve options representing object state

Returns: array

getPluginManager()

Get plugin manager instance

Returns: \FilterPluginManager

hasPcreUnicodeSupport()

Returns: bool

merge()

Merge the filter chain with the one given in parameter

Parameter Name Type Description
$filterChain \FilterChain

Returns: self

plugin()

Retrieve a filter plugin by name

Parameter Name Type Description
$name mixed
$options array

Returns: \FilterInterface

setOptions()

Parameter Name Type Description
$options array|\Traversable

Returns: self

setPluginManager()

Set plugin manager instance

Parameter Name Type Description
$plugins \FilterPluginManager

Returns: self

Top