/** * @param $method * @param $arguments */ public function __call($method, $arguments) { if (strpos($method, 'findBy') === false && strpos($method, 'findOne') === false) { throw new \InvalidArgumentException(sprintf('Method %s must follow code standards. Use findBy or findOne. For example: findOneAuthor', $method)); } if ($this->_class) { $this->_class->getRepository($this->_module); $this->_class->setInvokeColumns($this->getInvokeColumns()); $this->_class->setColumnMapper($this->getColumnMapper()); $this->_class->setEntityManager($this->getEntityManager()); $this->_class->setLanguageManager($this->getLanguageManager()); $this->_class->setContextManager($this->getContextManager()); $this->_class->setPivotResultChain($this->getPivotResultChain()); if (method_exists($this->_class, $method)) { return call_user_func_array(array($this->_class, $method), $arguments); } } throw new \InvalidArgumentException(sprintf('Method %s does not exists', $method)); }