projet-php/repositories/repos/PatientRepo.php

52 lines
1.4 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: seekdasky
* Date: 02/12/15
* Time: 12:36
*/
class PatientRepo
{
private $connexion;
public function __construct(){
$this->connexion = StaticRepo::getConnexion();
}
public function getById($id){
$req = $this->connexion->prepare('SELECT * FROM Patient WHERE Id = :id');
$req->execute(['id' => $id]);
return $req->fetchAll();
}
public function add($civilite,$prenom,$nom,$adresse,$ville,$codePostal,$dateNaissance,$lieuNaissance,$numSecu,$medecinTraitant = null){
$req = $this->connexion->prepare('INSERT INTO Patient VALUES (:civilite,:nom,:prenom,:adresse,:ville,:codePostal,:dateNaissance,:lieuNaissance,:numSecu,DEFAULT,:medecin)');
$req->execute(['civilite' => $civilite,
'nom' => $nom,
'prenom' => $prenom,
'adresse' => $adresse,
'ville' => $ville,
'codePostal' => $codePostal,
'dateNaissance' => $dateNaissance,
'lieuNaissance' => $lieuNaissance,
'numSecu' => $numSecu,
'medecin' => $medecinTraitant ]);
}
public function delete($idPatient){
}
public function updateMedecinTraitant($idPatient,$IdMedecin){
}
public function search($nom,$prenom){
}
}