ajouter getsexes

pull/7/head
Gwenael PLANCHON 1 year ago
parent 1a0f622e28
commit 5cdc0e6ddc

@ -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();
}
}

@ -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;
}
}
Loading…
Cancel
Save