Пример #1
0
 /**
    $app = $this->applications->get($calledApp, InternalApplication::EVENT_HELP);
 * @param $eventName
 */
 public function fire($eventName, EventInterface $event = null)
 {
     if (!empty($this->subscribers[$eventName])) {
         if (!$event) {
             $event = new Event($eventName);
         }
         foreach ($this->subscribers[$eventName] as $subscriber) {
             call_user_func_array(array($subscriber[0], $subscriber[1]), array($event));
             if ($event->isPropagationStopped() === true) {
                 break;
             }
         }
     }
 }
 /**
  * method that it's called on 'event.foo' - stop propagation
  *
  * @param Event $event
  */
 public function fooAction(Event $event)
 {
     $event->stopPropagation();
     $_SESSION['event.foo'] = rand(0, 10);
 }