Set the event manager instance used by this context

@param  EventManagerInterface $events

@return AbstractEntity
763203
public function setEventManager(EventManagerInterface $events) : AbstractEntity
    {
        $className = get_class($this);

        $nsPos = strpos($className, '\\') ?: 0;
        $events->setIdentifiers(
            array_merge(
                [
                    __CLASS__,
                    $className,
                    substr($className, 0, $nsPos),
                ],
                array_values(class_implements($className)),
                (array) $this->eventIdentifier
            )
        );

        $this->events = $events;

        return $this;
    }
639401
public function setEventManager(EventManagerInterface $eventManager)
    {
        $eventManager->setIdentifiers(
            array(
                __CLASS__,
                get_called_class(),
                $this->getName()
            )
        );
        $this->_events = $eventManager;
        return $this;
    }
802251
public function getEventManager()/*# : EventManagerInterface */
    {
        // create the default slave
        if (is_null($this->event_manager)) {
            // add own classname as scope
            $this->setEventManager(new EventDispatcher(get_class($this)));
        }

        // attach self to the event manager if not yet
        $this->attachSelfToEventManager();

        return $this->event_manager;
    }
987860
public function detach(EventManagerInterface $events)
    {
        foreach ($this->listeners as $listener) {
            $events->detach($listener);
        }
    }
1019307
public function attach(EventManagerInterface $events)
    {
        $this->listeners[] = $events->attach($this->eventBefore, array($this, 'prepareUpload'));
        $this->listeners[] = $events->attach($this->eventAfter, array($this, 'finalizeUpload'));
    }
946018
public function setEventHandler(EventInterface $handler, bool $static = false)
    {
        if ($static) {
            self::$globalEventHandler = $handler;
        }

        $this->eventHandler = $handler;

        return $this;
    }
489780
public function addEvent(AbstractEvent $event) {
        $this->eventHandlerFactory->getHandlerForEvent($event)->addEvent($event);
        return $this;
    }
142899
private function eventsShouldExistInStore(DomainEvent ...$events) {
        $expected = array_map(function (DomainEvent $event) {
            return $this->serializer->serialize($event);
        }, $events);

        $existing = $this->eventStore->getEvents()->map(function(DomainEvent $event) {
            return $this->serializer->serialize($event);
        })->toArray();

        $notFound = array_filter($expected, function($expectedEvent) use ($existing) {
            return ! in_array($expectedEvent, $existing);
        });

        if (empty($notFound)) return;

        throw new FailureException($this->missingEventExceptionMessage($notFound));
    }
1048525
public function setEventTrigger(EventTriggerInterface $eventTrigger)
    {
        $this->init();
        $eventService = new EventTriggerService();
        $eventService->registerEventDispatcher($eventTrigger);

        $this->container->instance(EventTriggerService::class, $eventService);
    }
395689
public function setEvents(array $events = []): Webhook
    {
        $validEvents = array_values(
            array_intersect(self::VALID_EVENTS, $events)
        );

        Assert::notEmpty($validEvents);

        $this->events = $validEvents;

        return $this;
    }
963310
public function setEvent(\Claroline\AgendaBundle\Entity\Event $event)
    {
        $this->event = $event;

        return $this;
    }
1169608
public function attach(EventManagerInterface $events)
    {
        $this->listeners[] = $events->attach(
            MvcEvent::EVENT_RENDER,
            [$this, 'renderLayoutSegments'],
            -100
        );
    }
977279
public function createSuccessFromEventCollection(
        EventCollection $events
    ): EventCollection {
        Assert::assertThat(true, Assert::isTrue());

        return $events;
    }
174083
public function setEventManager(EventManager $events)
    {
        if ($this->app instanceof PluginApplicationInterface) {
            $this->app->setEventManager($events);

            return $this;
        }

        throw new InvalidArgumentException('Cannot set the event manager, the application does not support events.');
    }
540524
public function detachShared(SharedEventManagerInterface $events)
    {
        if ($events->detach($this->listener,'Zend\Mvc\Application')) {
            $this->listener = null;
        }
        return $this;
    }
291203
public static function addEventEntry(AbstractEvent $event)
    {
        return new self(
            null !== $event->aggregateRoot ? $event->aggregateRoot->getId() : null,
            null !== $event->aggregateRoot ? get_class($event->aggregateRoot) : null,
            $event->author,
            get_class($event),
            $event->date,
            serialize($event)
        );
    }
1343250
public function attach(EventManagerInterface $events)
    {
        $sharedEvents = $events->getSharedManager();
        $this->listeners[] = $sharedEvents->attach(
            'Zend\Stdlib\DispatchableInterface', 
            MvcEvent::EVENT_DISPATCH, 
            array($this, 'checkEmailVerification'),
            10000);
    }