FilterChain
in package
implements
FilterInterface
FilterChain: intercepting filter manager
Interfaces, Classes, Traits and Enums
- FilterInterface
- Interface for intercepting filter chains
Table of Contents
- $filters : FilterIterator
- __construct() : mixed
- Constructor
- attach() : CallbackHandler
- Connect a filter to the chain
- clearFilters() : void
- Clear all filters
- detach() : bool
- Detach a filter from the chain
- getFilters() : FilterIterator
- Retrieve all filters
- getResponses() : null|ResponseCollection
- Return current responses
- run() : mixed
- Apply the filters
Properties
$filters
protected
FilterIterator
$filters
All filters
Methods
__construct()
Constructor
public
__construct() : mixed
Initializes Filter\FilterIterator in which filters will be aggregated
Return values
mixed —attach()
Connect a filter to the chain
public
attach(callable $callback[, int $priority = 1 ]) : CallbackHandler
Parameters
- $callback : callable
-
PHP Callback
- $priority : int = 1
-
Priority in the queue at which to execute; defaults to 1 (higher numbers == higher priority)
Tags
Return values
CallbackHandler —(to allow later unsubscribe)
clearFilters()
Clear all filters
public
clearFilters() : void
Return values
void —detach()
Detach a filter from the chain
public
detach(callable $filter) : bool
Parameters
- $filter : callable
Return values
bool —Returns true if filter found and unsubscribed; returns false otherwise
getFilters()
Retrieve all filters
public
getFilters() : FilterIterator
Return values
FilterIterator —getResponses()
Return current responses
public
getResponses() : null|ResponseCollection
Only available while the chain is still being iterated. Returns the current ResponseCollection.
Return values
null|ResponseCollection —run()
Apply the filters
public
run(mixed $context[, mixed $argv = [] ]) : mixed
Begins iteration of the filters.
Parameters
- $context : mixed
-
Object under observation
- $argv : mixed = []
-
Associative array of arguments