original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: This function is also used to work around 'protected' keyword problems in context_helper.
  @static
  @param stdClass $record
  @return context instance
docstring_tokens: This function is also used to work around protected keyword problems in context_helper .