public function exists(int $id) : bool {
        global $DB;
        return $DB->record_exists($this->favouritetable, ['id' => $id]);
    }
public function exists(int $id) : bool {
        global $DB;
        return $DB->record_exists($this->favouritetable, ['id' => $id]);
    }
public function exists ( int $ id ) : bool { global $ DB ; return $ DB -> record_exists ( $ this -> favouritetable , [ 'id' => $ id ] ) ; }
Check whether a favourite exists in this repository, based on its id.

@param int $id the id to search for.
@return bool true if the favourite exists, false otherwise.
@throws \dml_exception if any database errors are encountered.
Check whether a favourite exists in this repository based on its id .