public function detachAllEventsForObserver(IObserver $observerToRemove)
    {
        foreach ($this->_observers as $event => $observers) {
            foreach ($observers as $position => $observer) {

                if ($observer === $observerToRemove) {
                    array_splice($this->_observers[$event], $position, 1);
                    break; //Save cycles by breaking here since there is each observer is only attached to each event once.
                }
            }
        }
    }
public function detachAllEventsForObserver(IObserver $observerToRemove)
    {
        foreach ($this->_observers as $event => $observers) {
            foreach ($observers as $position => $observer) {

                if ($observer === $observerToRemove) {
                    array_splice($this->_observers[$event], $position, 1);
                    break; //Save cycles by breaking here since there is each observer is only attached to each event once.
                }
            }
        }
    }
public function detachAllEventsForObserver ( IObserver $ observerToRemove ) { foreach ( $ this -> _observers as $ event => $ observers ) { foreach ( $ observers as $ position => $ observer ) { if ( $ observer === $ observerToRemove ) { array_splice ( $ this -> _observers [ $ event ] , $ position , 1 ) ; break ; //Save cycles by breaking here since there is each observer is only attached to each event once. } } } }
Remove all events for an observer.
@param IObserver $observerToRemove The observer we wish to detach.
Remove all events for an observer .