diff --git a/dal/TaskGateway.php b/dal/TaskGateway.php index fc86142..6be9d18 100644 --- a/dal/TaskGateway.php +++ b/dal/TaskGateway.php @@ -48,7 +48,9 @@ class TaskGateway } /*si on veut trouver une liste, juste chercher toutes les taches avec idList= id_de_la_liste*/ - public function Find($element, $valeur){ + public function find($element="", $valeur=""){ + if($element="") + $query='SELECT * FROM Tache'; $query='SELECT * FROM Tache WHERE '.$element.'=:'.$element; $this->con->executeQuery($query, array( ':'.$element =>array($valeur,PDO::PARAM_STR))); diff --git a/dal/UserGateway.php b/dal/UserGateway.php index cf856c3..9361d12 100644 --- a/dal/UserGateway.php +++ b/dal/UserGateway.php @@ -1,5 +1,20 @@ \ No newline at end of file + public function __construct(Connection $con){ + $this->con=$con; + } + + public function insert(User $u){ + + } +} + + + +?> diff --git a/tests/test.php b/tests/test.php index ca341d9..ec8d383 100644 --- a/tests/test.php +++ b/tests/test.php @@ -4,7 +4,7 @@ require_once("../dal/TaskGateway.php"); echo "

2do test

"; # nouvelle tache -$t = new Task(10,'testNico','laDescription','urgent','001'); +$t = new Task(5,'tacheNotErr','desc.','urgent','001'); # connection include("credentials.php"); @@ -14,7 +14,9 @@ $con = new Connection('mysql:host=localhost;dbname=phpproject',$user,$pass); $tgt = new TaskGateway($con); //$tgt->insert($t); //$tgt->delete('10'); -$tasks=$tgt->Find('idList','001'); + +/* # test find +$tasks=$tgt->find('idList','001'); foreach($tasks as $i) echo $i->get_id()."
"; - +*/