original_string: protected function ensure_fields_exist($list, $caller) {
          global $DB;
          $missing = array_diff($list, array_keys((array)$this->record));
          if ($missing) {
              debugging('core_tag_tag::' . $caller . '() must be called on fully retrieved tag object. Missing fields: '.
                      join(', ', $missing), DEBUG_DEVELOPER);
              $this->record = $DB->get_record('tag', array('id' => $this->record->id), '*', MUST_EXIST);
          }
      }
code: protected function ensure_fields_exist($list, $caller) {
          global $DB;
          $missing = array_diff($list, array_keys((array)$this->record));
          if ($missing) {
              debugging('core_tag_tag::' . $caller . '() must be called on fully retrieved tag object. Missing fields: '.
                      join(', ', $missing), DEBUG_DEVELOPER);
              $this->record = $DB->get_record('tag', array('id' => $this->record->id), '*', MUST_EXIST);
          }
      }
code_tokens: protected function ensure_fields_exist ( $ list , $ caller ) { global $ DB ; $ missing = array_diff ( $ list , array_keys ( ( array ) $ this -> record ) ) ; if ( $ missing ) { debugging ( 'core_tag_tag::' . $ caller . '() must be called on fully retrieved tag object. Missing fields: ' . join ( ', ' , $ missing ) , DEBUG_DEVELOPER ) ; $ this -> record = $ DB -> get_record ( 'tag' , array ( 'id' => $ this -> record -> id ) , '*' , MUST_EXIST ) ; } }
docstring: Validates that the required fields were retrieved and retrieves them if missing
  
  @param array $list array of the fields that need to be validated
  @param string $caller name of the function that requested it, for the debugging message
docstring_tokens: Validates that the required fields were retrieved and retrieves them if missing