public function add(favourite $favourite) : favourite {
        global $DB;
        $this->validate($favourite);
        $favourite = (array)$favourite;
        $time = time();
        $favourite['timecreated'] = $time;
        $favourite['timemodified'] = $time;
        $id = $DB->insert_record($this->favouritetable, $favourite);
        return $this->find($id);
    }