Get a post movie ID securely

This commit is contained in:
Pierre
2018-01-06 19:03:26 +01:00
parent 9546895a4d
commit 5a75165082
2 changed files with 55 additions and 0 deletions

View File

@ -54,6 +54,16 @@ class Movies {
}
/**
* Check whether a movie specified by its ID exists or not
*
* @param int $movieID The ID of the movie to check
* @return bool TRUE if the movie exists / false else
*/
function exist(int $movieID) : bool {
return CS::get()->db->count($this::MOVIES_TABLE, "WHERE ID = ?", array($movieID)) > 0;
}
/**
* Parse a video informations
*