mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-30 09:16:35 +00:00
Can delete all the likes of an element.
This commit is contained in:
parent
773280973b
commit
a67c62fd95
@ -111,6 +111,24 @@ class Likes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the likes associated to an element
|
||||
*
|
||||
* @param int $id The ID of element to update
|
||||
* @param string $kind The kind of the component
|
||||
* @return bool TRUE for a success and FALSE for a failure
|
||||
*/
|
||||
public function delete_all(int $id, string $kind) : bool {
|
||||
|
||||
//Delete on the database
|
||||
return CS::get()->db->deleteEntry(
|
||||
$this::LIKES_TABLE,
|
||||
"ID_type = ? AND type = ?",
|
||||
array($id, $this::KINDS_DB[$kind])
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Register class
|
||||
|
Loading…
Reference in New Issue
Block a user