From db86ba1ac6425b55c81b83d065d2948853c0d402 Mon Sep 17 00:00:00 2001 From: "victor.soulier" Date: Sat, 18 Nov 2023 14:59:29 +0100 Subject: [PATCH] ADD : modele difficulte --- project/src/model/mdl/MdlDifficulte.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 project/src/model/mdl/MdlDifficulte.php diff --git a/project/src/model/mdl/MdlDifficulte.php b/project/src/model/mdl/MdlDifficulte.php new file mode 100644 index 0000000..ebe6546 --- /dev/null +++ b/project/src/model/mdl/MdlDifficulte.php @@ -0,0 +1,25 @@ +gw = new DifficulteGateway($this->con); + } + + public function getAll(): array{ + $listDifficulte = []; + foreach($this->gw->getAll() as $row){ + $listDifficulte[] = new Difficulte($row['id'], $row['libelle']); + } + return $listDifficulte; + } + + public function getFromId(int $id): Difficulte{ + $row = $this->gw->getFromId($id); + return new Difficulte($row['id'], $row['libelle']); + } +} \ No newline at end of file