lithium\core\StaticObjectDeprecated::_filter()
Executes a set of filters against a method by taking a method's main implementation as a callback, and iteratively wrapping the filters around it.
Parameters
-
string
$method
The name of the method being executed.
-
array
$params
An associative array containing all the parameters passed into the method.
-
\Closure
$callback
The method's implementation, wrapped in a closure.
-
array
$filters
Additional filters to apply to the method for this call only.
Returns
mixedSource
protected static function _filter($method, $params, $callback, $filters = []) {
$message = '`' . __METHOD__ . '()` has been deprecated in favor of ';
$message .= '`\lithium\aop\Filters::run()` and `::apply()`.';
trigger_error($message, E_USER_DEPRECATED);
if (strpos($method, '::') !== false) {
list($class, $method) = explode('::' , $method);
} else {
$class = get_called_class();
}
foreach ($filters as $filter) {
Filters::apply($class, $method, $filter);
}
return Filters::run($class, $method, $params, $callback);
}