From d6f2e9bac7051065755614529a799c191c589f4f Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 13 Jan 2018 19:07:15 +0100 Subject: [PATCH] Delete all the comments of a post --- classes/components/comments.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/classes/components/comments.php b/classes/components/comments.php index 01defe6..9e931e6 100644 --- a/classes/components/comments.php +++ b/classes/components/comments.php @@ -38,6 +38,19 @@ class Comments { } + /** + * Delete all the comments associated to a post + * + * @param int $postID The ID of the target post + * @return bool TRUE in case of success / FALSE else + */ + public function delete_all(int $postID) : bool { + + //Perform the request on the database + return CS::get()->db->deleteEntry($this::COMMENTS_TABLE, "ID_texte = ?", array($postID)); + + } + /** * Parse a comment informations *