src/Pupcake/Event.php
public function register()
    {
        $this->helper_callbacks = array();
        $arguments= func_get_args();
        if(count($arguments) > 0){
            foreach($arguments as $argument){
                if($argument instanceof Plugin){ //this is a plugin object
                    $callback = $argument->getEventHelperCallback($this->getName());
                    if(is_callable($callback)){
                        $this->helper_callbacks[] = $callback;
                    }                 
                }
                else if(is_callable($argument)){ //this is a closure
                    $this->helper_callbacks[] = $argument;
                }
            }
        }

        return $this; //return the event object reference to allow chainable calls
    }
public function register()
    {
        $this->helper_callbacks = array();
        $arguments= func_get_args();
        if(count($arguments) > 0){
            foreach($arguments as $argument){
                if($argument instanceof Plugin){ //this is a plugin object
                    $callback = $argument->getEventHelperCallback($this->getName());
                    if(is_callable($callback)){
                        $this->helper_callbacks[] = $callback;
                    }                 
                }
                else if(is_callable($argument)){ //this is a closure
                    $this->helper_callbacks[] = $argument;
                }
            }
        }

        return $this; //return the event object reference to allow chainable calls
    }
public function register ( ) { $ this -> helper_callbacks = array ( ) ; $ arguments = func_get_args ( ) ; if ( count ( $ arguments ) > 0 ) { foreach ( $ arguments as $ argument ) { if ( $ argument instanceof Plugin ) { //this is a plugin object $ callback = $ argument -> getEventHelperCallback ( $ this -> getName ( ) ) ; if ( is_callable ( $ callback ) ) { $ this -> helper_callbacks [ ] = $ callback ; } } else if ( is_callable ( $ argument ) ) { //this is a closure $ this -> helper_callbacks [ ] = $ argument ; } } } return $ this ; //return the event object reference to allow chainable calls }
register an array of plugins objects and allow the plugins to join the process of handling this event
register an array of plugins objects and allow the plugins to join the process of handling this event