original_string: protected static function validate_glossary($id) {
          global $DB;
          $glossary = $DB->get_record('glossary', array('id' => $id), '*', MUST_EXIST);
          list($course, $cm) = get_course_and_cm_from_instance($glossary, 'glossary');
          $context = context_module::instance($cm->id);
          self::validate_context($context);
          return array($glossary, $context, $course, $cm);
      }
code: protected static function validate_glossary($id) {
          global $DB;
          $glossary = $DB->get_record('glossary', array('id' => $id), '*', MUST_EXIST);
          list($course, $cm) = get_course_and_cm_from_instance($glossary, 'glossary');
          $context = context_module::instance($cm->id);
          self::validate_context($context);
          return array($glossary, $context, $course, $cm);
      }
code_tokens: protected static function validate_glossary ( $ id ) { global $ DB ; $ glossary = $ DB -> get_record ( 'glossary' , array ( 'id' => $ id ) , '*' , MUST_EXIST ) ; list ( $ course , $ cm ) = get_course_and_cm_from_instance ( $ glossary , 'glossary' ) ; $ context = context_module :: instance ( $ cm -> id ) ; self :: validate_context ( $ context ) ; return array ( $ glossary , $ context , $ course , $ cm ) ; }
docstring: Validate a glossary via ID.
  
  @param  int $id The glossary ID.
  @return array Contains glossary, context, course and cm.
docstring_tokens: Validate a glossary via ID .