erreur sur le insert TaskGateway.php

list-Gtw-Mdl
Nicolas FRANCO 2 years ago
parent e2009994bd
commit cc0f30d3a2

@ -28,5 +28,4 @@
return $this->stmt->fetchall();
}
}
?>

@ -1,11 +1,11 @@
<?php
require_once("Connection.php");
include_once("../business/Task.php");
include_once("..Connection.php");
class TaskGateway
class TaskGateway
{
// connection attribute
private Connection $con;
public Connection $con;
// constructor
public function __construct(Connection $con){
@ -16,10 +16,12 @@ include_once("..Connection.php");
// 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)));
$this->con->executeQuery($query, array(
':id'=> array($t->get_id(),PDO::PARAM_STR),
':titre'=> array($t->get_titre(),PDO::PARAM_STR),
':descript'=> array($t->get_description(),PDO::PARAM_STR),
':priotite'=> array($t->get_priorite(),PDO::PARAM_STR) ));
}
public function update($id_task){
@ -31,7 +33,7 @@ include_once("..Connection.php");
}
# comment ça marche ?
public function Find(array $elements):array{
public function Find($element, $valeur){
// Find a task by multiple elements
// returns the array of found tasks
}

Loading…
Cancel
Save