public function registerEvent($name, $methodName, $prepend = false)
    {
        if (!isset($this->events[$name])) {
            $this->events[$name] = array();
        }
        if (!in_array($methodName, $this->events[$name])) {
            if ($prepend) {
                array_unshift($this->events[$name], $methodName);
            } else {
                array_push($this->events[$name], $methodName);
            }
        }
        return $this;
    }
public function registerEvent($name, $methodName, $prepend = false)
    {
        if (!isset($this->events[$name])) {
            $this->events[$name] = array();
        }
        if (!in_array($methodName, $this->events[$name])) {
            if ($prepend) {
                array_unshift($this->events[$name], $methodName);
            } else {
                array_push($this->events[$name], $methodName);
            }
        }
        return $this;
    }
public function registerEvent ( $ name , $ methodName , $ prepend = false ) { if ( ! isset ( $ this -> events [ $ name ] ) ) { $ this -> events [ $ name ] = array ( ) ; } if ( ! in_array ( $ methodName , $ this -> events [ $ name ] ) ) { if ( $ prepend ) { array_unshift ( $ this -> events [ $ name ] , $ methodName ) ; } else { array_push ( $ this -> events [ $ name ] , $ methodName ) ; } } return $ this ; }
Register callback function to be called on certain events

@param string   $name       Name of event
@param function $methodName A anonymous function to be called
@param bool     $prepend    Whether the event should be prepended.

@return KoolReport the report object
Register callback function to be called on certain events