Get Event Manager

Lazy-loads an EventManager instance if none registered.

@return EventManagerInterface
343871
public function getEventManager()
    {
        if (null === $this->events) {
            $this->setEventManager(
                new EventManager(
                    $this->getServiceManager()->get('SharedEventManager'), [get_class($this)]
                )
            );
        }

        return $this->events;
    }
1156758
protected function eventCollection(): EventCollection
    {
        if ($this->eventCollection === null) {
            $this->eventCollection = new EventCollection($this->id(), Type::create($this));
        }

        return $this->eventCollection;
    }
1059224
public function getLoader(): LoaderInterface
    {
        if (!isset($this->i__loader)) {
            $this->i__loader = new DelegateLoader();
        }

        return $this->i__loader;
    }
1347651
public function getEventEmitter()
    {
        if ($this->eventEmitter == null) {
            $this->eventEmitter = new \Evenement\EventEmitter();
        }

        return $this->eventEmitter;
    }
869886
public function getTemplateManager() {
		// if the component has not been created yet
		if (!isset($this->templateManager)) {
			// create the component
			$this->templateManager = new TemplateManager($this->templatesPath, $this->frameworkStoragePath . self::TEMPLATES_CACHE_SUBFOLDER);

			// add the current instance as a global to the template manager
			$this->templateManager->addGlobal('app', $this);
		}

		// return the component
		return $this->templateManager;
	}
845301
function getWidgetManager()
    {
    	if (! $this->widgetManager) {
            $sm = $this->getServiceLocator()->getServiceLocator();
            $widgetManager  = $sm->get('yimaWidgetator.WidgetManager');

            if (!($widgetManager instanceof WidgetManager)
                || !($widgetManager instanceof AbstractPluginManager)
            )
                throw new \Exception(sprintf(
                    'WidgetManager must instance of WidgetManager or AbstractPluginManager, but "%s" given from \'yimaWidgetator.WidgetManager\'',
                    is_object($widgetManager) ? get_class($widgetManager) : gettype($widgetManager)
                ));

            $this->widgetManager = $widgetManager;
    	}

    	return $this->widgetManager;
    }
1336174
public function getEventManager()
    {
        if (is_null($this->_events)) {
            $container = ContainerBuilder::buildContainer(
                [
                    'DefaultEventManager' => Definition::object(
                            'Zend\EventManager\SharedEventManager'
                    )
                ]
            );
            $sharedEvents = $container->get('DefaultEventManager');
            $events = new EventManager();
            $events->setSharedManager($sharedEvents);
            $this->setEventManager($events);
        }
        return $this->_events;
    }
1135078
public function getContentManager()
    {
        if (null === $this->contentManager) {
            $this->contentManager = new Manager\ContentManager();
            $this->contentManager->setEditor($this);
        }

        return $this->contentManager;
    }
43879
public function getEntityManager()
    {
        if (!isset($this->_entityManager)) {
            $this->_entityManager = $this->getServiceLocator()
                    ->get('Doctrine\ORM\EntityManager');
        }
        return $this->_entityManager;
    }
577153
public static function getEventDispatcher(): EventDispatcherInterface
    {
        if (isset(self::$dispatchers[static::class])) {
            return self::$dispatchers[static::class];
        }

        return self::$dispatchers[static::class] = new EventDispatcher();
    }
344462
public function getEntityManager()
    {
        if ($this->em === null) {
            $this->setEntityManager($this->container->get('doctrine')->getManager($this->emName));
        }

        return $this->em;
    }
886717
public function setEventManager(EventManagerInterface $events)
    {
        
        $events->setIdentifiers(array(
            'Zend\Stdlib\DispatchableInterface',
            'Zend\Mvc\Controller\AbstractController',
            'Zend\Mvc\Controller\AbstractActionController',
            __CLASS__,
            get_called_class(),
            $this->eventIdentifier,
            substr(get_called_class(), 0, strpos(get_called_class(), '\\'))
        ));
        $this->events = $events;
        $this->attachDefaultListeners();

        return $this;
    }
1022365
public function getAnnotationManager()
    {
        if ($this->annotationManager) {
            return $this->annotationManager;
        }

        $this->setAnnotationManager(new AnnotationManager());
        return $this->annotationManager;
    }
956421
public function getEventModel()
    {
        if ($this->eventModel === null) {
            $this->load->model('setting/event');
            /** @noinspection PhpUndefinedFieldInspection */
            $this->eventModel = $this->model_setting_event;
        }
        return $this->eventModel;
    }
534625
public function getPageManager()
    {
        if ($this->pageManager === null) {
            $this->pageManager = new PageManager($this);
        }
        return $this->pageManager;
    }
582310
public function setEventManager(EventManagerInterface $eventManager)
    {
        $class = get_class($this);
        $eventManager->setIdentifiers(array(
            strtr($class, '\\', '.'),
            $class
        ));

        $this->eventManager = $eventManager;
        return $this;
    }
1306237
protected function getConfigurationManager()
	{
		if (!isset($this->configurationManager)) {
			$this->configurationManager = GeneralUtility::makeInstance(ObjectManager::class)
				->get(ConfigurationManager::class);
		}
		return $this->configurationManager;
	}