Exemple #1
0
 /**
  * Triggers an event.
  *
  * The instance of Zibo will always be passed as the first parameter to the
  * event listeners. All parameters passed after the event name of this
  * method call, will be passed through to the event listeners after the
  * Zibo instance.
  * @param string $eventName Name of the event
  * @return null
  * @throws zibo\ZiboException when trying to run a system event
  */
 public function triggerEvent($eventName)
 {
     $isEventAllowed = strlen($eventName) >= 7 && substr($eventName, 0, 7) == 'system.';
     if ($isEventAllowed) {
         throw new ZiboException('Can\'t run system events from outside the Zibo kernel.');
     }
     $arguments = func_get_args();
     $arguments[0] = $this;
     $this->eventManager->triggerEventWithArrayArguments($eventName, $arguments);
 }