diff --git a/Vues/addTask.php b/Vues/addTask.php
index 0d0bc81..d2d88cd 100644
--- a/Vues/addTask.php
+++ b/Vues/addTask.php
@@ -14,7 +14,7 @@
Ajouter une tâche
-
diff --git a/metier/Tache.php b/metier/Tache.php
index 57e4d4b..44e85d0 100644
--- a/metier/Tache.php
+++ b/metier/Tache.php
@@ -38,6 +38,10 @@ class Tache
return $this->completed;
}
+ public function setId(int $id){
+ $this->id=$id;
+ }
+
public function setName(string $name){
$this->name=$name;
}
diff --git a/modeles/MdlListe.php b/modeles/MdlListe.php
index c42ec34..e6b33da 100644
--- a/modeles/MdlListe.php
+++ b/modeles/MdlListe.php
@@ -82,7 +82,7 @@ class MdlListe{
$tabTache=[];
$taches=$gateTache->getTacheFromIdList($row['id']);
foreach($taches as $tata){
- $tabTache[]=new Tache($tata['id'], $tata['name'], $tata['content'], $tata['completed']);
+ $tabTache[]=new Tache($tata->getId(), $tata->getName(), $tata->getContent(), $tata->getCompleted());
}
$tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $user, $tabTache);
}
diff --git a/modeles/MdlTache.php b/modeles/MdlTache.php
index f91669a..36e3487 100644
--- a/modeles/MdlTache.php
+++ b/modeles/MdlTache.php
@@ -15,9 +15,9 @@ class MdlTache{
public function insert(string $name, string $content ,bool $completed, string $idListe): Tache{
$gate=new TacheGateway($this->con);
$t=new Tache(0, $name, $content, $completed);
- $gate->insert($t);
+ $gate->insert($t, $idListe);
$id=$gate->getLastId();
- $t->setId($id[0]['oldId']);
+ $t->setId($id);
return $t;
}