diff --git a/gateway/TacheGateway.php b/gateway/TacheGateway.php index 6af5bf1..bf67f0d 100644 --- a/gateway/TacheGateway.php +++ b/gateway/TacheGateway.php @@ -15,9 +15,9 @@ class TacheGateway $this->con->executeQuery($query, array(':name' => array($t->getName(), PDO::PARAM_STR), ':content' => array($t->getContent(), PDO::PARAM_STR), ':completed' => array($t->getCompleted(), PDO::PARAM_BOOL), ':idList' => array($idList, PDO::PARAM_INT))); } - public function delete(Tache $t): void{ + public function delete(int $id): void{ $query = "DELETE FROM Tache where id=:id"; - $this->con->executeQuery($query, array(':id' => array($t->getId(), PDO::PARAM_INT))); + $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); } public function update(Tache $t): void{ diff --git a/modeles/MdlTache.php b/modeles/MdlTache.php index 36e3487..81c4da8 100644 --- a/modeles/MdlTache.php +++ b/modeles/MdlTache.php @@ -21,9 +21,9 @@ class MdlTache{ return $t; } - public function delete(Tache $tache){ + public function delete(int $tachide){ $gate=new TacheGateway($this->con); - $gate->delete($tache); + $gate->delete($id); } public function update(Tache $tache, string $name, string $content, bool $completed){