Filters are provided by Amfphp to allow your contexts to 'filter into' the rest of Amfphp, i.e. to call functions in your context at specific times
Call addFilter to register a filter, with a default priority of 10, and call callFilter to actually execute the filter
The data structure is as follows: all registered filters : associative array ( filter name => name filters) name filters : associative array containing filters for one filter name (priority => priority filters) priority filters: numbered array containing filters for one filter name and one priority [callback1, callback2, etc.]
So for example if you were to call: addFilter("FILTER_1", $obj, "method1"); addFilter("FILTER_1", $obj, "method2"); addFilter("FILTER_1", $obj, "method3", 15); addFilter("FILTER_2", $obj, "method4");
the structure would be "FILTER_1" => array( 10 => [callback for method1, callback for method2] 15 => [callback for method3] "FILTER_2" => array( 10 => [callback for method4]
This is a singleton, so use getInstance
Located in /Amfphp/Core/FilterManager.php (line 38)
constructor
register an object method for the given filter
call this method in your contexts to be notified when the filter occures
call the functions registered for the given filter. There can be as many parameters as necessary, but only the first one can be changed and and returned by the callees.
The other parameters must be considered as context, and should not be modified by the callees, and will not be returned to the caller.
Documentation generated on Tue, 29 May 2012 23:42:03 +0200 by phpDocumentor 1.4.3