mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-25 13:08:58 +00:00
Can delete all the friends of a user
This commit is contained in:
parent
8f628327cf
commit
7ca5a29888
@ -383,6 +383,26 @@ class friends {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the friends of a user, including friendship requests
|
||||
*
|
||||
* @param int $userID The ID of the target user
|
||||
* @return bool TRUE for a success / FALSE else
|
||||
*/
|
||||
public function deleteAllUserFriends(int $userID) : bool {
|
||||
|
||||
//Delete the friend from the database
|
||||
$tableName = $this->friendsTable;
|
||||
$conditions = "ID_personne = ? OR ID_amis = ?";
|
||||
$condValues = array($userID, $userID);
|
||||
|
||||
//Try to perform the request
|
||||
$success = CS::get()->db->deleteEntry($tableName, $conditions, $condValues);
|
||||
|
||||
return $success;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse friend informations from the database
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user