original_string: function update_field() {
          global $DB;
  
          $DB->update_record('data_fields', $this->field);
  
          // Trigger an event for updating this field.
          $event = \mod_data\event\field_updated::create(array(
              'objectid' => $this->field->id,
              'context' => $this->context,
              'other' => array(
                  'fieldname' => $this->field->name,
                  'dataid' => $this->data->id
              )
          ));
          $event->trigger();
  
          return true;
      }
code: function update_field() {
          global $DB;
  
          $DB->update_record('data_fields', $this->field);
  
          // Trigger an event for updating this field.
          $event = \mod_data\event\field_updated::create(array(
              'objectid' => $this->field->id,
              'context' => $this->context,
              'other' => array(
                  'fieldname' => $this->field->name,
                  'dataid' => $this->data->id
              )
          ));
          $event->trigger();
  
          return true;
      }
code_tokens: function update_field ( ) { global $ DB ; $ DB -> update_record ( 'data_fields' , $ this -> field ) ; // Trigger an event for updating this field. $ event = \ mod_data \ event \ field_updated :: create ( array ( 'objectid' => $ this -> field -> id , 'context' => $ this -> context , 'other' => array ( 'fieldname' => $ this -> field -> name , 'dataid' => $ this -> data -> id ) ) ) ; $ event -> trigger ( ) ; return true ; }
docstring: Update a field in the database
  
  @global object
  @return bool
docstring_tokens: Update a field in the database