/** * Simple gate for Nette object events. * @param string method name * @param array arguments * @return mixed * @throws MemberAccessException */ public function __call($name, $args) { if ($name >= 'onA' && $name < 'on_') { return ObjectMixin::call($this, $name, $args); } else { throw new MemberAccessException($name); } }
public function fireEvent($method, $args = []) { if (!method_exists($this, $method)) { throw new InvalidArgumentException("Event '{$method}' does not exist."); } $this->eventCheck = FALSE; call_user_func_array([$this, $method], $args); if (!$this->eventCheck) { throw new InvalidStateException("Event '{$method}' was not correctly propagate to overwritten methods."); } if (property_exists($this, $method)) { ObjectMixin::call($this, $method, $args); } }
/** * Callbacks * @param string $name * @param array $args * @return mixed * @throws MemberAccessException */ public function __call($name, $args) { return ObjectMixin::call($this, $name, $args); }
protected function fireEvent(IEntity $entity, $event) { if (!property_exists($this, $event)) { throw new InvalidArgumentException("Event '{$event}' is not defined."); } $entity->fireEvent($event); ObjectMixin::call($this, $event, [$entity]); }
/** * @param string $name * @param array $args * * @return mixed */ public function __call($name, $args) { if (method_exists('Nette\\Utils\\ObjectMixin', 'callProperty')) { return ObjectMixin::callProperty($this, $name, $args); } else { return ObjectMixin::call($this, $name, $args); } }
/** * Call to undefined method. * * @param string $name * @param array $args * * @throws \Nette\MemberAccessException * @return mixed */ public function __call($name, $args) { if (strpos($name, 'findBy') === 0 || strpos($name, 'findOneBy') === 0) { return parent::__call($name, $args); } return ObjectMixin::call($this, $name, $args); }
/** * Call to undefined method. * @param string method name * @param array arguments * @return mixed * @throws MemberAccessException */ public function __call($name, $args) { return Nette\Utils\ObjectMixin::call($this, $name, $args); }
/** * Call to undefined method. * @param string method name * @param array arguments * @return mixed * @throws MemberAccessException */ public function __call(string $name, array $args) { return ObjectMixin::call($this, $name, $args); }