Can get the number of friendship request with the notifications.

This commit is contained in:
Pierre HUBERT
2018-08-24 08:25:38 +02:00
parent 85582a44cc
commit e1760dd772
2 changed files with 20 additions and 1 deletions

View File

@ -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
*