ajout editScientifique

pull/7/head
Gwenael PLANCHON 1 year ago
parent e971de1295
commit c7255091ec

@ -41,4 +41,29 @@ class ScientifiqueGateway
":idSexe"=>[$sci->getSexe()->getId(),$this->con::PARAM_STR]
]);
}
public function editScientifique(Scientifique $sci): bool{
return $this->con->executeQuery(
"UPDATE Scientifique SET nom = :nom, prenom = :prenom, photo = :photo, dateNaissance = :dateNaissance, descriptif = :descriptif, ratioTrouvee = :ratioTrouvee, idThematique = :idThematique, idDifficulte = :idDifficulte, idSexe = :idSexe WHERE id=:id;"
,[
":nom"=>[$sci->getNom(),$this->con::PARAM_STR],
":prenom"=>[$sci->getPrenom(),$this->con::PARAM_STR],
":photo"=>[$sci->getPhoto(),$this->con::PARAM_STR],
":dateNaissance"=>[date("Y-m-d H:i:s", $sci->getDateNaiss()->getTimestamp()),$this->con::PARAM_STR],
":descriptif"=>[$sci->getDescriptif(),$this->con::PARAM_STR],
":ratioTrouvee"=>[$sci->getRatioTrouvee(),$this->con::PARAM_STR],
":idThematique"=>[$sci->getThematique()->getId(),$this->con::PARAM_STR],
":idDifficulte"=>[$sci->getDifficulte()->getId(),$this->con::PARAM_STR],
":idSexe"=>[$sci->getSexe()->getId(),$this->con::PARAM_STR],
":id"=>[$sci->getId(),$this->con::PARAM_INT]
]);
}
public function getScientifique(int $id): b {
$this->con->executeQuery(
"SELECT id, nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, idSexe FROM Scientifique WHERE id=:id;"
,[
":id"=>[$id,$this->con::PARAM_INT]
]);
return $this->con->getOneResult();
}
}
Loading…
Cancel
Save