src/Budkit/Event/Observer.php
public function trigger($event)
    {

        if (is_string($event)) {
            $event = new Event($event);
        }
        $listeners = $this->getListeners($event->name);

        if (empty($listeners)) {
            return $event;
        }

        //print_r($listeners);

        //die;

        //Priorities... the bigger the more urgent
        $urgency = ksort($listeners, SORT_NUMERIC);
        $callbacks = array_reverse($listeners, true);

        //Loop through callbacks;
        foreach ($callbacks as $priority => $listener) {
            if ($event->isStopped()) {
                break;
            }

            foreach ($listener as $callback) {
                if ($event->isStopped()) {
                    break;
                }
                $this->propergate($event, $callback);
            }
        }

        return $event;
    }
public function trigger($event)
    {

        if (is_string($event)) {
            $event = new Event($event);
        }
        $listeners = $this->getListeners($event->name);

        if (empty($listeners)) {
            return $event;
        }

        //print_r($listeners);

        //die;

        //Priorities... the bigger the more urgent
        $urgency = ksort($listeners, SORT_NUMERIC);
        $callbacks = array_reverse($listeners, true);

        //Loop through callbacks;
        foreach ($callbacks as $priority => $listener) {
            if ($event->isStopped()) {
                break;
            }

            foreach ($listener as $callback) {
                if ($event->isStopped()) {
                    break;
                }
                $this->propergate($event, $callback);
            }
        }

        return $event;
    }
public function trigger ( $ event ) { if ( is_string ( $ event ) ) { $ event = new Event ( $ event ) ; } $ listeners = $ this -> getListeners ( $ event -> name ) ; if ( empty ( $ listeners ) ) { return $ event ; } //print_r($listeners); //die; //Priorities... the bigger the more urgent $ urgency = ksort ( $ listeners , SORT_NUMERIC ) ; $ callbacks = array_reverse ( $ listeners , true ) ; //Loop through callbacks; foreach ( $ callbacks as $ priority => $ listener ) { if ( $ event -> isStopped ( ) ) { break ; } foreach ( $ listener as $ callback ) { if ( $ event -> isStopped ( ) ) { break ; } $ this -> propergate ( $ event , $ callback ) ; } } return $ event ; }
Triggers an event;

@param string $eventName

@return void
@author Livingstone Fultang
Triggers an event ;