/** * Allow for filter chaining * * @param string $method The function name * @param array $arguments The function arguments * @return mixed The result of the function * @throws \BadMethodCallException If method could not be found */ public function __call($method, $arguments) { //Call the method on the filter if it exists if ($this->_last instanceof FilterInterface) { $methods = $this->_last->getMethods(); if (isset($methods[$method])) { call_user_func_array(array($this->_last, $method), $arguments); return $this; } } //Create a new filter based on the method name $filter = $this->getObject('filter.factory')->createFilter($method, $arguments); $this->addFilter($filter); return $this; }