original_string: public function flag() {
          global $DB;
  
          $this->ensure_fields_exist(array('name', 'userid', 'rawname', 'flag'), 'flag');
  
          // Update all the tags to flagged.
          $this->timemodified = time();
          $this->flag++;
          $DB->update_record('tag', array('timemodified' => $this->timemodified,
              'flag' => $this->flag, 'id' => $this->id));
  
          $event = \core\event\tag_flagged::create(array(
              'objectid' => $this->id,
              'relateduserid' => $this->userid,
              'context' => context_system::instance(),
              'other' => array(
                  'name' => $this->name,
                  'rawname' => $this->rawname
              )
  
          ));
          $event->trigger();
      }
code: public function flag() {
          global $DB;
  
          $this->ensure_fields_exist(array('name', 'userid', 'rawname', 'flag'), 'flag');
  
          // Update all the tags to flagged.
          $this->timemodified = time();
          $this->flag++;
          $DB->update_record('tag', array('timemodified' => $this->timemodified,
              'flag' => $this->flag, 'id' => $this->id));
  
          $event = \core\event\tag_flagged::create(array(
              'objectid' => $this->id,
              'relateduserid' => $this->userid,
              'context' => context_system::instance(),
              'other' => array(
                  'name' => $this->name,
                  'rawname' => $this->rawname
              )
  
          ));
          $event->trigger();
      }
code_tokens: public function flag ( ) { global $ DB ; $ this -> ensure_fields_exist ( array ( 'name' , 'userid' , 'rawname' , 'flag' ) , 'flag' ) ; // Update all the tags to flagged. $ this -> timemodified = time ( ) ; $ this -> flag ++ ; $ DB -> update_record ( 'tag' , array ( 'timemodified' => $ this -> timemodified , 'flag' => $ this -> flag , 'id' => $ this -> id ) ) ; $ event = \ core \ event \ tag_flagged :: create ( array ( 'objectid' => $ this -> id , 'relateduserid' => $ this -> userid , 'context' => context_system :: instance ( ) , 'other' => array ( 'name' => $ this -> name , 'rawname' => $ this -> rawname ) ) ) ; $ event -> trigger ( ) ; }
docstring: Flag a tag as inappropriate
docstring_tokens: Flag a tag as inappropriate