diff --git a/project/src/model/gateways/DifficulteGateway.php b/project/src/model/gateways/DifficulteGateway.php new file mode 100644 index 0000000..5917df4 --- /dev/null +++ b/project/src/model/gateways/DifficulteGateway.php @@ -0,0 +1,21 @@ +con = $con; + } + public function getAll() : array + { + $this->con->executeQuery("SELECT id, libelle FROM Difficulte;"); + $listDifficulte = []; + foreach($this->con->getResults() as $row){ + $listDifficulte[] = new Difficulte($row['id'], $row['libelle']); + } + return $listDifficulte; + } +} \ No newline at end of file diff --git a/project/src/model/metier/Difficulte.php b/project/src/model/metier/Difficulte.php new file mode 100644 index 0000000..838d89a --- /dev/null +++ b/project/src/model/metier/Difficulte.php @@ -0,0 +1,33 @@ +id=$id; + $this->libelle=$libelle; + } + + /** + * @return int + */ + public function getId(): int{ + return $this->id; + } + + /** + * @return string + */ + public function getLibelle(): string{ + return $this->libelle; + } +} \ No newline at end of file diff --git a/project/src/model/metier/Difficulty.php b/project/src/model/metier/Difficulty.php deleted file mode 100644 index 79801e9..0000000 --- a/project/src/model/metier/Difficulty.php +++ /dev/null @@ -1,10 +0,0 @@ -