예제 #1
0
 private function doDispatch($listeners, IEvent $event)
 {
     foreach ($listeners as $listener) {
         $this->invoker->invoke($listener, $event->getParameters(), array($event, $event->getSubject()));
         if ($event->isPropagationStopped()) {
             break;
         }
     }
 }
예제 #2
0
 /**
  * 
  * @param TestableService $service
  * 
  * @\Nucleus\IService\EventDispatcher\Listen("Service.servicefortest.postInitialized")
  */
 public function listenLifeCycle(TestableService $service, IEvent $event)
 {
     if ($event->getName() == 'Service.servicefortest.postInitialized' && $this === $service) {
         $this->postInitialized = true;
     }
 }
 public function postFoo(IEvent $e)
 {
     $this->postFooInvoked = true;
     $e->stopPropagation();
 }