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.
ProjetPHP/model/TaskModel.php

44 lines
972 B

<?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);
}
}
?>