parent
5783e51cb5
commit
7f6b0f4bcb
@ -0,0 +1,35 @@
|
|||||||
|
<?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){
|
||||||
|
// insert a new task
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Task $t){
|
||||||
|
// update a task
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(Task $t){
|
||||||
|
// delete a task
|
||||||
|
}
|
||||||
|
|
||||||
|
# comment ça marche ?
|
||||||
|
public function Find(array $elements):array{
|
||||||
|
// Find a task by multiple elements
|
||||||
|
// returns the array of found tasks
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
static $user = 'nifranco';
|
||||||
|
static $pass = 'f3wn5ady';
|
||||||
|
?>
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
require("../dal/Connection.php");
|
||||||
|
require("credentials.php");
|
||||||
|
|
||||||
|
$prio='urgent';
|
||||||
|
$con = new Connection('mysql:host=localhost;dbname=phpproject',$user,$pass);
|
||||||
|
$query = 'SELECT id FROM Tache WHERE priorite=:prio';
|
||||||
|
|
||||||
|
$con->executeQuery($query,array(
|
||||||
|
':prio'=>array($prio,PDO::PARAM_STR)));
|
||||||
|
|
||||||
|
$results=$con->getResults();
|
||||||
|
foreach($results as $row)
|
||||||
|
echo $row['id'];
|
||||||
|
|
||||||
|
echo "</br> its all good!";
|
||||||
|
?>
|
Loading…
Reference in new issue