diff --git a/project/src/model/gateways/SexeGateway.php b/project/src/model/gateways/SexeGateway.php index 3a4e608..f2672cf 100644 --- a/project/src/model/gateways/SexeGateway.php +++ b/project/src/model/gateways/SexeGateway.php @@ -16,4 +16,10 @@ class SexeGateway [':id' => [$id, $this->con::PARAM_INT]]); return $this->con->getOneResult(); } + + public function getSexes(): array + { + $this->con->executeQuery("SELECT id, libelle FROM Sexe;"); + return $this->con->getResults(); + } } \ No newline at end of file diff --git a/project/src/model/mdl/MdlSexe.php b/project/src/model/mdl/MdlSexe.php index bc9cf40..0bb7362 100644 --- a/project/src/model/mdl/MdlSexe.php +++ b/project/src/model/mdl/MdlSexe.php @@ -14,4 +14,12 @@ class MdlSexe extends MdlBase{ $row = $this->gw->getFromId($id); return new Sexe($row['id'], $row['libelle']); } + public function getSexes(): array { + $ret=array(); + $row = $this->gw->getSexes(); + for($i=0; $i< count($row); $i++){ + array_push($ret, new Sexe($row[$i]['id'], $row[$i]['libelle'])); + } + return $ret; + } } \ No newline at end of file