protected static function create_instance_from_record(stdClass $record) {
        $classname = context_helper::get_class_for_level($record->contextlevel);

        if ($context = context::cache_get_by_id($record->id)) {
            return $context;
        }

        $context = new $classname($record);
        context::cache_add($context);

        return $context;
    }
protected static function create_instance_from_record(stdClass $record) {
        $classname = context_helper::get_class_for_level($record->contextlevel);

        if ($context = context::cache_get_by_id($record->id)) {
            return $context;
        }

        $context = new $classname($record);
        context::cache_add($context);

        return $context;
    }
protected static function create_instance_from_record ( stdClass $ record ) { $ classname = context_helper :: get_class_for_level ( $ record -> contextlevel ) ; if ( $ context = context :: cache_get_by_id ( $ record -> id ) ) { return $ context ; } $ context = new $ classname ( $ record ) ; context :: cache_add ( $ context ) ; return $ context ; }
This function is also used to work around 'protected' keyword problems in context_helper.
@static
@param stdClass $record
@return context instance
This function is also used to work around protected keyword problems in context_helper .