src/EventManager.php
public function attach(ObserverInterface $observer)
    {
        $observers = $this->getObservers();

        foreach ($observer->getEvents() as $event) {
            $observers[$event][] = $observer;
        }

        $this->setObservers($observers);
    }
public function attach(ObserverInterface $observer)
    {
        $observers = $this->getObservers();

        foreach ($observer->getEvents() as $event) {
            $observers[$event][] = $observer;
        }

        $this->setObservers($observers);
    }
public function attach ( ObserverInterface $ observer ) { $ observers = $ this -> getObservers ( ) ; foreach ( $ observer -> getEvents ( ) as $ event ) { $ observers [ $ event ] [ ] = $ observer ; } $ this -> setObservers ( $ observers ) ; }
Method responsible for adding observers to event manager
@todo fail if observer has no events
@param  ObserverInterface $observer
Method responsible for adding observers to event manager