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