public static function load($param) {
        global $DB;
        if (is_object($param)) {
            $event = new calendar_event($param);
        } else {
            $event = $DB->get_record('event', array('id' => (int)$param), '*', MUST_EXIST);
            $event = new calendar_event($event);
        }
        return $event;
    }
public static function load($param) {
        global $DB;
        if (is_object($param)) {
            $event = new calendar_event($param);
        } else {
            $event = $DB->get_record('event', array('id' => (int)$param), '*', MUST_EXIST);
            $event = new calendar_event($event);
        }
        return $event;
    }
public static function load ( $ param ) { global $ DB ; if ( is_object ( $ param ) ) { $ event = new calendar_event ( $ param ) ; } else { $ event = $ DB -> get_record ( 'event' , array ( 'id' => ( int ) $ param ) , '*' , MUST_EXIST ) ; $ event = new calendar_event ( $ event ) ; } return $ event ; }
Returns an event object when provided with an event id.

This function makes use of MUST_EXIST, if the event id passed in is invalid
it will result in an exception being thrown.

@param int|object $param event object or event id
@return calendar_event
Returns an event object when provided with an event id .