call() public static méthode

__call() implementation.
public static call ( $_this, $name, $args ) : mixed
Résultat mixed
Exemple #1
0
 /**
  * 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);
     }
 }
Exemple #3
0
 /**
  * Callbacks
  * @param string $name
  * @param array $args
  * @return mixed
  * @throws MemberAccessException
  */
 public function __call($name, $args)
 {
     return ObjectMixin::call($this, $name, $args);
 }
Exemple #4
0
 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]);
 }
Exemple #5
0
 /**
  * @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);
 }
Exemple #7
0
 /**
  * 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);
 }
Exemple #8
0
 /**
  * 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);
 }