public function update(favourite $favourite) : favourite {
        global $DB;
        $time = time();
        $favourite->timemodified = $time;
        $DB->update_record($this->favouritetable, $favourite);
        return $this->find($favourite->id);
    }
public function update(favourite $favourite) : favourite {
        global $DB;
        $time = time();
        $favourite->timemodified = $time;
        $DB->update_record($this->favouritetable, $favourite);
        return $this->find($favourite->id);
    }
public function update ( favourite $ favourite ) : favourite { global $ DB ; $ time = time ( ) ; $ favourite -> timemodified = $ time ; $ DB -> update_record ( $ this -> favouritetable , $ favourite ) ; return $ this -> find ( $ favourite -> id ) ; }
Update a favourite.

@param favourite $favourite the favourite to update.
@return favourite the updated favourite.
@throws \dml_exception if any database errors are encountered.
Update a favourite .