diff --git a/modeles/MdlListe.php b/modeles/MdlListe.php index e6b33da..3c9ca42 100644 --- a/modeles/MdlListe.php +++ b/modeles/MdlListe.php @@ -55,18 +55,18 @@ class MdlListe{ return $tabListe; } - public function findById(string $id): array{ + public function findById(string $id): Liste{ $gate=new ListeGateway($this->con); $gateTache=new TacheGateway($this->con); $results=$gate->findById($id); - $tabListe=[]; + $tabListe=null; foreach ($results as $row ) { $tabTache=[]; $taches=$gateTache->getTacheFromIdList($row['id']); foreach($taches as $tata){ $tabTache[]=$tata; } - $tabListe[]=new Liste($row['id'], $row['name'], $row['private'], null, $tabTache); + $tabListe=new Liste($row['id'], $row['name'], $row['private'], null, $tabTache); } return $tabListe; }