src/AbstractEntityService.php
public function setEventManager(EventManagerInterface $eventManager)
    {
        if ($this->eventManager === $eventManager || $eventManager === null) {
            return;
        }

        if ($this->eventManager !== null) {
            $this->detach($this->eventManager);
        }

        $this->eventManager = $eventManager;
        $this->eventManager->addIdentifiers([
            'EntityService',
            'PolderKnowledge\EntityService\Service\EntityService',
            $this->getEntityServiceName(),
            trim($this->getEntityServiceName(), '\\'),
        ]);

        $this->attach($this->eventManager);
    }
public function setEventManager(EventManagerInterface $eventManager)
    {
        if ($this->eventManager === $eventManager || $eventManager === null) {
            return;
        }

        if ($this->eventManager !== null) {
            $this->detach($this->eventManager);
        }

        $this->eventManager = $eventManager;
        $this->eventManager->addIdentifiers([
            'EntityService',
            'PolderKnowledge\EntityService\Service\EntityService',
            $this->getEntityServiceName(),
            trim($this->getEntityServiceName(), '\\'),
        ]);

        $this->attach($this->eventManager);
    }
public function setEventManager ( EventManagerInterface $ eventManager ) { if ( $ this -> eventManager === $ eventManager || $ eventManager === null ) { return ; } if ( $ this -> eventManager !== null ) { $ this -> detach ( $ this -> eventManager ) ; } $ this -> eventManager = $ eventManager ; $ this -> eventManager -> addIdentifiers ( [ 'EntityService' , 'PolderKnowledge\EntityService\Service\EntityService' , $ this -> getEntityServiceName ( ) , trim ( $ this -> getEntityServiceName ( ) , '\\' ) , ] ) ; $ this -> attach ( $ this -> eventManager ) ; }
Set the EventManager used by this service instance to handle its events.
It will take care of disabling the old EventManager and will subscribe the internal
listeners to the new EventManager

@param EventManagerInterface $eventManager
Set the EventManager used by this service instance to handle its events . It will take care of disabling the old EventManager and will subscribe the internal listeners to the new EventManager