|
|
|
@ -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{
|
|
|
|
|