rectification d'un truc pas ouf

main
thchazot1 2 years ago
parent b2fb03908a
commit 38921c6aef

@ -8,7 +8,7 @@ require_once("connection.php");
require_once('tacheGateway.php');
require_once('userGateway.php');
require_once("listeGateway.php");
require_once('user.php');
require_once('metier/user.php');
//A CHANGER
$user= 'thchazot1';

@ -14,9 +14,6 @@ class ListeGateway
public function insert(Liste $l): void{
$tacheGateway=new TacheGateway($this->con);
foreach($l->getTaches() as $taches){
$tacheGateway->insert($taches, $this->getLastId()+1);
}
if ($l->getCreator()==null){
$query = "INSERT INTO Liste VALUES (null, :name, :private, null)";
$this->con->executeQuery($query, array(':name' => array($l->getName(), PDO::PARAM_STR), ':private' => array($l->getPrivate(), PDO::PARAM_BOOL)));
@ -25,6 +22,9 @@ class ListeGateway
$query = "INSERT INTO Liste VALUES (null, :name, :private, :creator)";
$this->con->executeQuery($query, array(':name' => array($l->getName(), PDO::PARAM_STR), ':private' => array($l->getPrivate(), PDO::PARAM_BOOL), ':creator' => array($l->getCreator()->getId(), PDO::PARAM_STR)));
}
foreach($l->getTaches() as $taches){
$tacheGateway->insert($taches, $this->getLastId());
}
}
public function delete(Liste $l): void{

Loading…
Cancel
Save