From 0af8d23970a3e421db72ce3e19c97fb2e8e8c761 Mon Sep 17 00:00:00 2001 From: SIMAILA Djalim Date: Tue, 24 Jan 2023 19:35:32 +0100 Subject: [PATCH] added static delete method --- Models/DifficultyModel.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Models/DifficultyModel.php b/Models/DifficultyModel.php index 47f787d..d45289c 100644 --- a/Models/DifficultyModel.php +++ b/Models/DifficultyModel.php @@ -55,4 +55,12 @@ final class DifficultyModel if ($row === false) return null; return DifficultyModel::getByID($row['ID']); } + public static function deleteByID($I_id) + { + $O_model = Model::get(); + UserModel::anonymiseByID($I_id); + $stmt = $O_model->prepare("DELETE FROM DIFFICULTY WHERE ID=:id"); + $stmt->bindParam("id", $I_id); + $stmt->execute(); + } }