mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Can get the ID of the owner of a movie.
This commit is contained in:
parent
5a75165082
commit
ad25e93557
@ -60,10 +60,26 @@ class Movies {
|
||||
* @param int $movieID The ID of the movie to check
|
||||
* @return bool TRUE if the movie exists / false else
|
||||
*/
|
||||
function exist(int $movieID) : bool {
|
||||
public function exist(int $movieID) : bool {
|
||||
return CS::get()->db->count($this::MOVIES_TABLE, "WHERE ID = ?", array($movieID)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ID of the owner of a movie
|
||||
*
|
||||
* @param int $movieID The ID of the target movie
|
||||
* @return int The ID of the owner of the movie / 0 if none found
|
||||
*/
|
||||
public function get_owner(int $movieID) : int {
|
||||
|
||||
//Get infos about the movie
|
||||
$movieInfos = $this->get_infos($movieID);
|
||||
|
||||
//Return the ID of the owner of the movie
|
||||
return isset($movieInfos["userID"]) ? $movieInfos["userID"] : 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a video informations
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user