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 *