protected function registerListeners($service)
    {
        $serviceMetadata = $this->serviceMetadataFactory->getMetadataFor(get_class($service));

        foreach ($serviceMetadata->getAllListeners() as $event => $listeners) {
            foreach ($listeners as $listener) {
                $this->eventManager->addListener($event, array($service, $listener));
            }
        }
    }
protected function registerListeners($service)
    {
        $serviceMetadata = $this->serviceMetadataFactory->getMetadataFor(get_class($service));

        foreach ($serviceMetadata->getAllListeners() as $event => $listeners) {
            foreach ($listeners as $listener) {
                $this->eventManager->addListener($event, array($service, $listener));
            }
        }
    }
protected function registerListeners ( $ service ) { $ serviceMetadata = $ this -> serviceMetadataFactory -> getMetadataFor ( get_class ( $ service ) ) ; foreach ( $ serviceMetadata -> getAllListeners ( ) as $ event => $ listeners ) { foreach ( $ listeners as $ listener ) { $ this -> eventManager -> addListener ( $ event , array ( $ service , $ listener ) ) ; } } }
Registers listeners for the supplied service instance. Listeners are obtained from ServiceMetadata for
the class of the instance.

@param object $service
Registers listeners for the supplied service instance . Listeners are obtained from ServiceMetadata for the class of the instance .