public function on($event, callable $fn) {
        if (!isset($this->events[$event])) {
            $this->events[$event] = [];
        }
        $this->events[$event][] = $fn;
        return $this;
    }
public function on($event, callable $fn) {
        if (!isset($this->events[$event])) {
            $this->events[$event] = [];
        }
        $this->events[$event][] = $fn;
        return $this;
    }
public function on ( $ event , callable $ fn ) { if ( ! isset ( $ this -> events [ $ event ] ) ) { $ this -> events [ $ event ] = [ ] ; } $ this -> events [ $ event ] [ ] = $ fn ; return $ this ; }
Set an action to do on the specified event

@param int $event event code
@param callable $fn function to call when the event is triggered
@return TcTable
Set an action to do on the specified event