mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can delete all the notifications of a user
This commit is contained in:
@ -274,6 +274,22 @@ class notificationComponent {
|
||||
return CS::get()->db->deleteEntry(self::NOTIFICATIONS_TABLE, $conditions, $values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the notifications of a user
|
||||
*
|
||||
* @param int $userID The ID of the target user
|
||||
* @return bool TRUE for a success / FALSE for a failure
|
||||
*/
|
||||
public function delete_all_user(int $userID) : bool {
|
||||
|
||||
//Perform the request
|
||||
$notif = new Notification();
|
||||
$notif->set_dest_user_id($userID);
|
||||
return $this->delete($notif);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a notification object into database array
|
||||
*
|
||||
|
Reference in New Issue
Block a user