From 3c34865a6a6d166fe3a09d1b850c5db6d585965a Mon Sep 17 00:00:00 2001 From: Kevin MONDEJAR Date: Wed, 23 Oct 2024 15:15:07 +0200 Subject: [PATCH] Supprimer 'models/questionModel.php' --- models/questionModel.php | 65 ---------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 models/questionModel.php diff --git a/models/questionModel.php b/models/questionModel.php deleted file mode 100644 index d0dc225..0000000 --- a/models/questionModel.php +++ /dev/null @@ -1,65 +0,0 @@ - gateway = $gateway; - } - - public function createQuestion(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer) : bool - { - $q = new QuestionEntity($id_question, $question, $answerA, $answerB, $answerC, $answerD, $cAnswer); - return $this -> gateway -> create($q); - } - - public function getQuestion(int $id_question) : ?QuestionEntity - { - return $this -> gateway -> findById($id_question); - } - - public function updateTextQuestion(int $id_question, string $question) : bool - { - $q = $this -> gateway -> findById($id_question); - - if ($q) - { - $q -> setQuestion($question); - return $this -> gateway -> updateText($q); - } - - return false; - } - - public function updateAnswersQuestion(int $id_question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer) : bool - { - $q = $this -> gateway -> findById($id_question); - - if ($q) - { - $q -> setAnswerA($answerA); - $q -> setAnswerB($answerB); - $q -> setAnswerC($answerC); - $q -> setAnswerD($answerD); - $q -> setAnswerC($cAnswer); - return $this -> gateway -> updateAnswers($q); - } - - return false; - } - - public function deleteQuestion(int $id_question) : bool - { - return $this -> gateway -> delete($id_question); - } - - public function getAllQuestions() : array - { - return $this -> gateway -> findAll(); - } -} \ No newline at end of file