protected function addEventsListeners() { foreach ($this->_dependencyContainer->getAllDependencies() as $name => $info) { if (is_callable(array($info['className'], 'getEventListeners'))) { $events = $this->_dependencyContainer->get($name)->getEventListeners(); foreach ($events as $eventName => $params) { if (!is_array($params)) { $params = array('listener' => $params); } $this->_eventDispatcher->addEventListener($eventName, $params['listener']); } } } }
public static function get($dependency) { return self::$_dependencyContainerInstance->get($dependency); }