public function initializeEventListeners()
    {
        $configuration = $this->getConfiguration();
        $eventDispatcher = $this->getContainer()->get('event_dispatcher');
        foreach ($configuration->getEventListeners() as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                list($listenerClassName, $listenerMethodName) = explode('::', $listener);

                $listenerInstance = ObjectFactory::getInstance()->newInstance($listenerClassName);
                if ($listenerInstance !== null) {
                    $eventDispatcher->addListener($eventName, array($listenerInstance, $listenerMethodName));
                }
            }
        }

        foreach ($configuration->getEventSubscribers() as $subscriber) {
            $subscriberInstance = ObjectFactory::getInstance()->newInstance($subscriber['class'], $subscriber);
            if ($subscriberInstance instanceof EventSubscriberInterface) {
                $eventDispatcher->addSubscriber($subscriberInstance);
            }
        }
    }
public function initializeEventListeners()
    {
        $configuration = $this->getConfiguration();
        $eventDispatcher = $this->getContainer()->get('event_dispatcher');
        foreach ($configuration->getEventListeners() as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                list($listenerClassName, $listenerMethodName) = explode('::', $listener);

                $listenerInstance = ObjectFactory::getInstance()->newInstance($listenerClassName);
                if ($listenerInstance !== null) {
                    $eventDispatcher->addListener($eventName, array($listenerInstance, $listenerMethodName));
                }
            }
        }

        foreach ($configuration->getEventSubscribers() as $subscriber) {
            $subscriberInstance = ObjectFactory::getInstance()->newInstance($subscriber['class'], $subscriber);
            if ($subscriberInstance instanceof EventSubscriberInterface) {
                $eventDispatcher->addSubscriber($subscriberInstance);
            }
        }
    }
public function initializeEventListeners ( ) { $ configuration = $ this -> getConfiguration ( ) ; $ eventDispatcher = $ this -> getContainer ( ) -> get ( 'event_dispatcher' ) ; foreach ( $ configuration -> getEventListeners ( ) as $ eventName => $ listeners ) { foreach ( $ listeners as $ listener ) { list ( $ listenerClassName , $ listenerMethodName ) = explode ( '::' , $ listener ) ; $ listenerInstance = ObjectFactory :: getInstance ( ) -> newInstance ( $ listenerClassName ) ; if ( $ listenerInstance !== null ) { $ eventDispatcher -> addListener ( $ eventName , array ( $ listenerInstance , $ listenerMethodName ) ) ; } } } foreach ( $ configuration -> getEventSubscribers ( ) as $ subscriber ) { $ subscriberInstance = ObjectFactory :: getInstance ( ) -> newInstance ( $ subscriber [ 'class' ] , $ subscriber ) ; if ( $ subscriberInstance instanceof EventSubscriberInterface ) { $ eventDispatcher -> addSubscriber ( $ subscriberInstance ) ; } } }
Initializes the event listeners and subscribers configured in the configuration.
Initializes the event listeners and subscribers configured in the configuration .