|
|
@ -71,14 +71,12 @@ class MdlListe{
|
|
|
|
return $tabListe;
|
|
|
|
return $tabListe;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function findByUser(string $username): array{
|
|
|
|
public function findByUser(User $user): array{
|
|
|
|
$gate=new ListeGateway($this->con);
|
|
|
|
$gate=new ListeGateway($this->con);
|
|
|
|
$gateTache=new TacheGateway($this->con);
|
|
|
|
$gateTache=new TacheGateway($this->con);
|
|
|
|
$gateUser=new UserGateway($this->con);
|
|
|
|
$gateUser=new UserGateway($this->con);
|
|
|
|
|
|
|
|
|
|
|
|
$id=$gateUser->findByName($username);
|
|
|
|
$results=$gate->findByUserId($user->getId());
|
|
|
|
$id=$id['id'];
|
|
|
|
|
|
|
|
$results=$gate->findByUserId($id);
|
|
|
|
|
|
|
|
$tabListe=[];
|
|
|
|
$tabListe=[];
|
|
|
|
foreach ($results as $row ) {
|
|
|
|
foreach ($results as $row ) {
|
|
|
|
$tabTache=[];
|
|
|
|
$tabTache=[];
|
|
|
@ -86,7 +84,7 @@ class MdlListe{
|
|
|
|
foreach($taches as $tata){
|
|
|
|
foreach($taches as $tata){
|
|
|
|
$tabTache[]=new Tache($tata['id'], $tata['name'], $tata['content'], $tata['completed']);
|
|
|
|
$tabTache[]=new Tache($tata['id'], $tata['name'], $tata['content'], $tata['completed']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $u, $tabTache);
|
|
|
|
$tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $user, $tabTache);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $tabListe;
|
|
|
|
return $tabListe;
|
|
|
|
}
|
|
|
|
}
|
|
|
|