diff --git a/inc/Data/ReportQueries.php b/inc/Data/ReportQueries.php index 4488a20c..682ed917 100644 --- a/inc/Data/ReportQueries.php +++ b/inc/Data/ReportQueries.php @@ -205,6 +205,17 @@ class ReportQueries { $query->execute(); } + /** + * Deletes all reports from of the given post. + * + * @param int $post_id The post's id. + */ + public function deleteByPost(int $post_id) { + $query = $this->pdo->prepare('DELETE FROM `reports` WHERE `post` = :post'); + $query->bindValue(':post', $post_id); + $query->execute(); + } + /** * Inserts a new report. *