projet-php/repositories/repos/RDVRepo.php

50 lines
1.1 KiB
PHP
Executable File

<?php
/**
* Created by PhpStorm.
* User: seekdasky
* Date: 02/12/15
* Time: 12:36
*/
class RDVRepo
{
private $connexion;
public function __construct(){
$this->connexion = StaticRepo::getConnexion();
}
public function getById($id){
$req = $this->connexion->prepare('SELECT * FROM RDV WHERE Id = :id');
$req->execute(['id' => $id]);
return $req->fetchAll();
}
public function getByDate($date){
$date = strtotime($date);
$date = date('o-m-d',$date);
$req = $this->connexion->prepare('SELECT * FROM RDV WHERE DATE(FROM_UNIXTIME(1449136444)) = :date');
$req->execute(['date' => $date]);
return StaticRepo::delNumeric($req->fetchAll());
}
public function delete($idRDV){
$req = $this->connexion->prepare('DELETE FROM RDV WHERE Id = :id');
return $req->execute(['id' => $idRDV]);
}
public function add($timestamp,$duree,$idPatient,$idMedecin){
}
public function updateDateTime($idRDV,$dateTime){
}
public function getByPatientAndDate($idPatient,$date){
}
}