|
|
@ -55,6 +55,27 @@ class MdlListe{
|
|
|
|
return $tabListe;
|
|
|
|
return $tabListe;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function findById(string $id): array{
|
|
|
|
|
|
|
|
$gate=new ListeGateway($this->con);
|
|
|
|
|
|
|
|
$gateTache=new TacheGateway($this->con);
|
|
|
|
|
|
|
|
$results=$gate->findById($id);
|
|
|
|
|
|
|
|
$tabListe=[];
|
|
|
|
|
|
|
|
foreach ($results as $row ) {
|
|
|
|
|
|
|
|
$tabTache=[];
|
|
|
|
|
|
|
|
$taches=$gateTache->getTacheFromIdList($row['id']);
|
|
|
|
|
|
|
|
foreach($taches as $tata){
|
|
|
|
|
|
|
|
$tabTache[]=new Tache($tata['id'], $tata['name'], $tata['content'], $tata['completed']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($row['private']==false){
|
|
|
|
|
|
|
|
$tabListe[]=new Liste($row['id'], $row['name'], $row['private'], null, $tabTache);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($row['idCreator']==$u->getId()){
|
|
|
|
|
|
|
|
$tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $u, $tabTache);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return $tabListe;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function findByUser(string $username): array{
|
|
|
|
public function findByUser(string $username): array{
|
|
|
|
$gate=new ListeGateway($this->con);
|
|
|
|
$gate=new ListeGateway($this->con);
|
|
|
|
$gateTache=new TacheGateway($this->con);
|
|
|
|
$gateTache=new TacheGateway($this->con);
|
|
|
|