Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
FilterChain Class Reference

FilterChain: intercepting filter manager. More...

Public Member Functions

 __construct ()
 Constructor.
 
 run ($context, array $argv=[])
 Apply the filters.
 
 attach (callable $callback, $priority=1)
 Connect a filter to the chain.
 
 detach (callable $filter)
 Detach a filter from the chain.
 
 getFilters ()
 Retrieve all filters.
 
 clearFilters ()
 Clear all filters.
 
 getResponses ()
 Return current responses.
 
- Public Member Functions inherited from FilterInterface
 attach (callable $callback)
 Attach an intercepting filter.
 

Protected Attributes

 $filters
 

Detailed Description

FilterChain: intercepting filter manager.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Initializes Filter in which filters will be aggregated

Member Function Documentation

attach ( callable  $callback,
  $priority = 1 
)

Connect a filter to the chain.

Parameters
callable$callbackPHP Callback
int$priorityPriority in the queue at which to execute; defaults to 1 (higher numbers == higher priority)
Returns
CallbackHandler (to allow later unsubscribe)
Exceptions
Exception\InvalidCallbackException
clearFilters ( )

Clear all filters.

Returns
void

Implements FilterInterface.

detach ( callable  $filter)

Detach a filter from the chain.

Parameters
callable$filter
Returns
bool Returns true if filter found and unsubscribed; returns false otherwise

Implements FilterInterface.

getFilters ( )

Retrieve all filters.

Returns
Filter

Implements FilterInterface.

getResponses ( )

Return current responses.

Only available while the chain is still being iterated. Returns the current ResponseCollection.

Returns
null|ResponseCollection

Implements FilterInterface.

run (   $context,
array  $argv = [] 
)

Apply the filters.

Begins iteration of the filters.

Parameters
mixed$contextObject under observation
mixed$argvAssociative array of arguments
Returns
mixed

Implements FilterInterface.

Member Data Documentation

$filters
protected