src/event/EventManager.php
public function notify() {
        $observersToNotify = array();

        //Check which observers must be update
        foreach ($this->_observers as $observer) {
            if ($this->checkIfObserverMustBeUpdate($observer)) {
                //Add the observers in array to be order for priority
                $observersToNotify[] = $observer;
            }
        }

        //Order the list of observers
        usort($observersToNotify, array($this,'orderObserversForPriority'));

        //Update the observers
        foreach ($observersToNotify as $observer) {
            try {
                $this->updateObserverState($observer);
            } catch (\Exception $e) {
                if ((int)$e->getCode()===600) { //Stop propagation
                    break 1;
                }
            }
        }

    }
public function notify() {
        $observersToNotify = array();

        //Check which observers must be update
        foreach ($this->_observers as $observer) {
            if ($this->checkIfObserverMustBeUpdate($observer)) {
                //Add the observers in array to be order for priority
                $observersToNotify[] = $observer;
            }
        }

        //Order the list of observers
        usort($observersToNotify, array($this,'orderObserversForPriority'));

        //Update the observers
        foreach ($observersToNotify as $observer) {
            try {
                $this->updateObserverState($observer);
            } catch (\Exception $e) {
                if ((int)$e->getCode()===600) { //Stop propagation
                    break 1;
                }
            }
        }

    }
public function notify ( ) { $ observersToNotify = array ( ) ; //Check which observers must be update foreach ( $ this -> _observers as $ observer ) { if ( $ this -> checkIfObserverMustBeUpdate ( $ observer ) ) { //Add the observers in array to be order for priority $ observersToNotify [ ] = $ observer ; } } //Order the list of observers usort ( $ observersToNotify , array ( $ this , 'orderObserversForPriority' ) ) ; //Update the observers foreach ( $ observersToNotify as $ observer ) { try { $ this -> updateObserverState ( $ observer ) ; } catch ( \ Exception $ e ) { if ( ( int ) $ e -> getCode ( ) === 600 ) { //Stop propagation break 1 ; } } } }
Send a notification to the correct observer
Send a notification to the correct observer