mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can get the number of friendship request with the notifications.
This commit is contained in:
@ -409,6 +409,19 @@ class friends {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the number of friendship requests a user has received
|
||||
*
|
||||
* @param int $userID Target user ID
|
||||
* @return int The number of friendship request the user received
|
||||
*/
|
||||
public function count_requests(int $userID) : int {
|
||||
return db()->count(
|
||||
$this->friendsTable,
|
||||
"WHERE ID_personne = ? AND actif = 0",
|
||||
array($userID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse friend informations from the database
|
||||
*
|
||||
|
Reference in New Issue
Block a user