Can respond to call

This commit is contained in:
2019-01-25 09:34:40 +01:00
parent 8d004e80f5
commit d1be731fb4
2 changed files with 59 additions and 0 deletions

View File

@ -220,6 +220,21 @@ class CallsComponents {
}
/**
* Check out whether a user belongs to a call or not
*
* @param $callID The ID of the target call
* @param $userID The ID of the target user
* @return bool TRUE if the user belongs to the call / FALSE else
*/
public function doesUserBelongToCall(int $callID, int $userID) : bool {
return db()->count(
self::CALLS_MEMBERS_TABLE,
"WHERE call_id = ? AND user_id = ?",
array($callID, $userID)
) > 0;
}
/**
* Set the response of a member to a call
*