Delete all the comments of a post

This commit is contained in:
Pierre 2018-01-13 19:07:15 +01:00
parent 336fa60314
commit d6f2e9bac7

View File

@ -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 * Parse a comment informations
* *