parent
b9efb2e41a
commit
7c7d1431c1
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
include_once("../dal/TaskGateway.php");
|
||||||
|
include_once("../business/Task.php");
|
||||||
|
|
||||||
|
class TaskModel
|
||||||
|
{
|
||||||
|
public Connection $con;
|
||||||
|
public TaskGateway $gtw;
|
||||||
|
|
||||||
|
public function __construct(Connection $con)
|
||||||
|
{
|
||||||
|
$this->con=$con;
|
||||||
|
$this->gtw= new TaskGateway($con);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addTask($id,$titre,$desc,$priorite,$idList,$dateDeb="",$dateFin="")
|
||||||
|
{
|
||||||
|
$t = new Task($id,$titre,$desc,$priorite,$idList,$dateDeb,$dateFin);
|
||||||
|
$this->gtw->insert($t);
|
||||||
|
// retourne quoi? con->lastInsertId() ??
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supTask($element,$valeur)
|
||||||
|
{
|
||||||
|
$this->gtw->delete($element,$valeur);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifTask($id,$element,$valeur)
|
||||||
|
{
|
||||||
|
$this->gtw->update($id,$element,$valeur);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllTask()
|
||||||
|
{
|
||||||
|
return $this->gtw->find();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTaskBy($element,$valeur)
|
||||||
|
{
|
||||||
|
return $this->gtw->find($element,$valeur);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in new issue