Example #1
0
 /**
  * Convenience method for triggering the event from the event object.
  *
  * @param  Zumba\Symbiosis\EventRegistry $registry Single registry instance if used outside of global context.
  * @return boolean
  */
 public function trigger(EventRegistry $registry = null)
 {
     if ($this->pluginContext) {
         return $this->pluginContext->trigger($this);
     }
     return $registry instanceof EventRegistry ? $registry->trigger($this) : EventManager::trigger($this);
 }
Example #2
0
 /**
  * Trigger an event to the bound context of this plugin manager.
  *
  * @param Zumba\Symbiosis\Event\Event $event
  * @param array $data
  * @return boolean
  */
 public function trigger(Event $event, $data = array())
 {
     if (!$this->context instanceof EventRegistry) {
         return EventManager::trigger($event, $data);
     }
     return $this->context->trigger($event, $data);
 }