1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-02 12:57:35 +01:00

ReportQueries.php: add deleteByPost

This commit is contained in:
Zankaria 2024-12-06 22:43:01 +01:00
parent fafe9a0257
commit 47432f9ae5

View File

@ -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.
*