FilterChain: intercepting filter manager.
More...
|
| __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.
|
|
| attach (callable $callback) |
| Attach an intercepting filter.
|
|
FilterChain: intercepting filter manager.
Constructor.
Initializes Filter in which filters will be aggregated
attach |
( |
callable |
$callback, |
|
|
|
$priority = 1 |
|
) |
| |
Connect a filter to the chain.
- Parameters
-
callable | $callback | PHP Callback |
int | $priority | Priority in the queue at which to execute; defaults to 1 (higher numbers == higher priority) |
- Returns
- CallbackHandler (to allow later unsubscribe)
- Exceptions
-
Exception\InvalidCallbackException | |
detach |
( |
callable |
$filter | ) |
|
Detach a filter from the chain.
- Parameters
-
- Returns
- bool Returns true if filter found and unsubscribed; returns false otherwise
Implements FilterInterface.
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 | $context | Object under observation |
mixed | $argv | Associative array of arguments |
- Returns
- mixed
Implements FilterInterface.