From e64f991bd466aa5fa17c6ffc9ea06b74179d4665 Mon Sep 17 00:00:00 2001 From: "victor.soulier" Date: Sun, 19 Nov 2023 12:50:38 +0100 Subject: [PATCH] ADD : mdl, metier, gw thematique --- .../src/model/gateways/ThematiqueGateway.php | 19 ++++++++++++++ project/src/model/mdl/MdlThematique.php | 17 +++++++++++++ project/src/model/metier/Thematique.php | 25 +++++++++++++++++++ project/src/model/metier/Theme.php | 11 -------- 4 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 project/src/model/gateways/ThematiqueGateway.php create mode 100644 project/src/model/mdl/MdlThematique.php create mode 100644 project/src/model/metier/Thematique.php delete mode 100644 project/src/model/metier/Theme.php 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 @@ -