generated from Templates_CodeFirst/templateHtmlCss
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
945 B
39 lines
945 B
<?php
|
|
|
|
|
|
class MdlTache{
|
|
|
|
private $con;
|
|
|
|
public function __construct(){
|
|
|
|
global $rep,$vues,$dsn, $login, $password;
|
|
$this->con = new Connection($dsn, $login, $password);
|
|
}
|
|
|
|
|
|
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);
|
|
$id=$gate->getLastId();
|
|
$t->setId($id[0]['oldId']);
|
|
return $t;
|
|
}
|
|
|
|
public function delete(Tache $tache){
|
|
$gate=new TacheGateway($this->con);
|
|
$gate->delete($tache);
|
|
}
|
|
|
|
public function update(Tache $tache, string $name, string $content, bool $completed){
|
|
$gate=new ListeGateway($this->con);
|
|
$tache->setName($name);
|
|
$tache->setContent($content);
|
|
$tache->setCompleted($completed);
|
|
$gate->update($tache);
|
|
}
|
|
|
|
}
|
|
|
|
?>
|