diff --git a/project/src/model/gateways/ThematiqueGateway.php b/project/src/model/gateways/ThematiqueGateway.php new file mode 100644 index 0000000..deb64cf --- /dev/null +++ b/project/src/model/gateways/ThematiqueGateway.php @@ -0,0 +1,19 @@ +con = $con; + } + + public function getFromId(int $id): array + { + $this->con->executeQuery("SELECT id, libelle FROM Thematique WHERE id=:id;", + [':id' => [$id, $this->con::PARAM_INT]]); + return $this->con->getOneResult(); + } +} \ No newline at end of file diff --git a/project/src/model/mdl/MdlThematique.php b/project/src/model/mdl/MdlThematique.php new file mode 100644 index 0000000..d09f2ca --- /dev/null +++ b/project/src/model/mdl/MdlThematique.php @@ -0,0 +1,17 @@ +gw = new ThematiqueGateway($this->con); + } + + public function getFromId(int $id): Thematique{ + $row = $this->gw->getFromId($id); + return new Thematique($row['id'], $row['libelle']); + } +} \ No newline at end of file diff --git a/project/src/model/metier/Thematique.php b/project/src/model/metier/Thematique.php new file mode 100644 index 0000000..7258408 --- /dev/null +++ b/project/src/model/metier/Thematique.php @@ -0,0 +1,25 @@ +id=$id; + $this->libelle=$libelle; + } + + public function getId():int + { + return $this->id; + } + + public function getLibelle(): string + { + return $this->libelle; + } +} \ No newline at end of file diff --git a/project/src/model/metier/Theme.php b/project/src/model/metier/Theme.php deleted file mode 100644 index e28e6ea..0000000 --- a/project/src/model/metier/Theme.php +++ /dev/null @@ -1,11 +0,0 @@ -