Apply a closure to a method of the current static object.
Parameters
- mixed $method The name of the method to apply the closure to. Can either be a single method name as a string, or an array of method names.
- closure $filter The closure that is used to filter the method.
Returns
voidSource
public static function applyFilter($method, $filter = null) {
$class = get_called_class();
foreach ((array) $method as $m) {
if (!isset(static::$_methodFilters[$class][$m])) {
static::$_methodFilters[$class][$m] = array();
}
static::$_methodFilters[$class][$m][] = $filter;
}
}