original_string: public function update(favourite $favourite) : favourite {
          global $DB;
          $time = time();
          $favourite->timemodified = $time;
          $DB->update_record($this->favouritetable, $favourite);
          return $this->find($favourite->id);
      }
code: public function update(favourite $favourite) : favourite {
          global $DB;
          $time = time();
          $favourite->timemodified = $time;
          $DB->update_record($this->favouritetable, $favourite);
          return $this->find($favourite->id);
      }
code_tokens: public function update ( favourite $ favourite ) : favourite { global $ DB ; $ time = time ( ) ; $ favourite -> timemodified = $ time ; $ DB -> update_record ( $ this -> favouritetable , $ favourite ) ; return $ this -> find ( $ favourite -> id ) ; }
docstring: Update a favourite.
  
  @param favourite $favourite the favourite to update.
  @return favourite the updated favourite.
  @throws \dml_exception if any database errors are encountered.
docstring_tokens: Update a favourite .