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.
40 lines
938 B
40 lines
938 B
<?php
|
|
include_once("../business/Task.php");
|
|
include_once("..Connection.php");
|
|
|
|
class TaskGateway
|
|
{
|
|
// connection attribute
|
|
private Connection $con;
|
|
|
|
// constructor
|
|
public function __construct(Connection $con){
|
|
$this->con=$con;
|
|
}
|
|
|
|
// functions
|
|
// code de retour pour les fonctions i,u,d?
|
|
public function insert(Task $t){
|
|
$query='INSERT INTO Tache VALUES (:id,:titre,:descript,:priorite)';
|
|
$this->con->executeQuery($query, array(':id'=> array($t->id,PDO::PARAM_STR),
|
|
':titre'=> array($t->titre,PDO::PARAM_STR),
|
|
':descript'=> array($t->description,PDO::PARAM_STR),
|
|
':priotite'=> array($t->priorite,PDO::PARAM_STR)));
|
|
}
|
|
|
|
public function update($id_task){
|
|
// update a task
|
|
}
|
|
|
|
public function delete($id_task){
|
|
// delete a task
|
|
}
|
|
|
|
# comment ça marche ?
|
|
public function Find(array $elements):array{
|
|
// Find a task by multiple elements
|
|
// returns the array of found tasks
|
|
}
|
|
}
|
|
?>
|