original_string: public static function view_entry($id) {
          global $DB, $USER;
  
          $params = self::validate_parameters(self::view_entry_parameters(), array('id' => $id));
          $id = $params['id'];
          $warnings = array();
  
          // Get and validate the glossary.
          $entry = $DB->get_record('glossary_entries', array('id' => $id), '*', MUST_EXIST);
          list($glossary, $context, $course, $cm) = self::validate_glossary($entry->glossaryid);
  
          if (!glossary_can_view_entry($entry, $cm)) {
              throw new invalid_parameter_exception('invalidentry');
          }
  
          // Trigger view.
          glossary_entry_view($entry, $context);
  
          return array(
              'status' => true,
              'warnings' => $warnings
          );
      }
code: public static function view_entry($id) {
          global $DB, $USER;
  
          $params = self::validate_parameters(self::view_entry_parameters(), array('id' => $id));
          $id = $params['id'];
          $warnings = array();
  
          // Get and validate the glossary.
          $entry = $DB->get_record('glossary_entries', array('id' => $id), '*', MUST_EXIST);
          list($glossary, $context, $course, $cm) = self::validate_glossary($entry->glossaryid);
  
          if (!glossary_can_view_entry($entry, $cm)) {
              throw new invalid_parameter_exception('invalidentry');
          }
  
          // Trigger view.
          glossary_entry_view($entry, $context);
  
          return array(
              'status' => true,
              'warnings' => $warnings
          );
      }
code_tokens: public static function view_entry ( $ id ) { global $ DB , $ USER ; $ params = self :: validate_parameters ( self :: view_entry_parameters ( ) , array ( 'id' => $ id ) ) ; $ id = $ params [ 'id' ] ; $ warnings = array ( ) ; // Get and validate the glossary. $ entry = $ DB -> get_record ( 'glossary_entries' , array ( 'id' => $ id ) , '*' , MUST_EXIST ) ; list ( $ glossary , $ context , $ course , $ cm ) = self :: validate_glossary ( $ entry -> glossaryid ) ; if ( ! glossary_can_view_entry ( $ entry , $ cm ) ) { throw new invalid_parameter_exception ( 'invalidentry' ) ; } // Trigger view. glossary_entry_view ( $ entry , $ context ) ; return array ( 'status' => true , 'warnings' => $ warnings ) ; }
docstring: Notify that the entry was viewed.
  
  @param int $id The entry ID.
  @return array of warnings and status result
  @since Moodle 3.1
  @throws moodle_exception
  @throws invalid_parameter_exception
docstring_tokens: Notify that the entry was viewed .