|
|
@ -12,7 +12,7 @@ class PartieGateway
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->con = $con;
|
|
|
|
$this->con = $con;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function creerPartie(){
|
|
|
|
public function creerPartie($listeEmailJoueur){
|
|
|
|
$query = "SELECT * FROM Enigme";
|
|
|
|
$query = "SELECT * FROM Enigme";
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
$results = $this->con->getResults();
|
|
|
|
$results = $this->con->getResults();
|
|
|
@ -20,7 +20,7 @@ class PartieGateway
|
|
|
|
FROM PARTIE p;";
|
|
|
|
FROM PARTIE p;";
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
$max=$this->con->getResults()[0];
|
|
|
|
$max=$this->con->getResults()[0];
|
|
|
|
$partie=PartieFactory::createPartie($max,$results);
|
|
|
|
$partie=PartieFactory::createPartie($max,$results,$listeEmailJoueur);
|
|
|
|
$query= "INSERT INTO Partie VALUES (:idPartie,:idEnigme)";
|
|
|
|
$query= "INSERT INTO Partie VALUES (:idPartie,:idEnigme)";
|
|
|
|
$this->con->executeQuery($query, array(':idPartie' => array($partie->getIdPartie(), PDO::PARAM_STR)));
|
|
|
|
$this->con->executeQuery($query, array(':idPartie' => array($partie->getIdPartie(), PDO::PARAM_STR)));
|
|
|
|
foreach($partie->getListeEnigme() as $Enigme){
|
|
|
|
foreach($partie->getListeEnigme() as $Enigme){
|
|
|
@ -46,13 +46,6 @@ class PartieGateway
|
|
|
|
$tabEnigme=EnigmeFactory::create($results);
|
|
|
|
$tabEnigme=EnigmeFactory::create($results);
|
|
|
|
return $tabEnigme;
|
|
|
|
return $tabEnigme;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function findIdMax(){
|
|
|
|
|
|
|
|
$query= "SELECT max(p.id)
|
|
|
|
|
|
|
|
FROM PARTIE p;";
|
|
|
|
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
|
|
|
|
$results=$this->con->getResults();
|
|
|
|
|
|
|
|
return $results[0]->max;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function showAll() : void{
|
|
|
|
public function showAll() : void{
|
|
|
|
$query= "SELECT * FROM Partie";
|
|
|
|
$query= "SELECT * FROM Partie";
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|