public static function setEvents($pEvents = NULL)
    {
        if ($pEvents === NULL) {
            $pEvents = Agl::app()->getConfig('main/events');
        }

        if (is_array($pEvents)) {
            self::$_events = $pEvents;
        } else {
            self::$_events = array();
        }

        return self::$_events;
    }