private function doDispatch($listeners, IEvent $event) { foreach ($listeners as $listener) { $this->invoker->invoke($listener, $event->getParameters(), array($event, $event->getSubject())); if ($event->isPropagationStopped()) { break; } } }
/** * * @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(); }