예제 #1
0
 /**
  * @param Event $event
  */
 protected function dispatchEvent(Event $event)
 {
     $type = $event->getType();
     if ($this->hasListenersForType($type)) {
         foreach ($this->eventListeners[$type] as $listener) {
             call_user_func($listener, $event);
             if ($event->cancelled()) {
                 break;
             }
         }
     }
 }
예제 #2
0
 /**
  * @param string $type
  * @param ComponentInterface $component
  * @param bool $cancellable
  */
 public function __construct($type = self::GENERIC, ComponentInterface $component, $cancellable = true)
 {
     parent::__construct($type, $cancellable);
     $this->component = $component;
 }
예제 #3
0
 /**
  * @param string $type
  * @param FormInterface $form
  * @param bool $cancellable
  */
 public function __construct($type = self::GENERIC, FormInterface $form, $cancellable = true)
 {
     parent::__construct($type, $cancellable);
     $this->form = $form;
 }
예제 #4
0
 /**
  * @param Event $e
  */
 public function onFormValid(Event $e)
 {
     echo $e->getType() . '<br/>';
 }