src/Listener/DeferredListenerAggregate.php
public function attach(EventManagerInterface $events, $priority = 1)
    {
        foreach ($this->listenerSpecs as $name => $spec) {
            $this->listeners[] = $events->attach($spec['event'], array($this, "do$name"), $spec['priority']);
        }
    }
public function attach(EventManagerInterface $events, $priority = 1)
    {
        foreach ($this->listenerSpecs as $name => $spec) {
            $this->listeners[] = $events->attach($spec['event'], array($this, "do$name"), $spec['priority']);
        }
    }
Attachs listener creation and invokation callback.

For each specification this aggregate attachs itself to the event manager on the
specified event to be able to react upon triggering.

@param EventManagerInterface $events

@return void