parent
2088859911
commit
ca99c45b5e
@ -1,52 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class DetailPartieGateway
|
|
||||||
{
|
|
||||||
private Connection $con;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Connection $con
|
|
||||||
*/
|
|
||||||
public function __construct(Connection $con)
|
|
||||||
{
|
|
||||||
$this->con = $con;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Connection $con
|
|
||||||
*/
|
|
||||||
public function setCon(Connection $con): void
|
|
||||||
{
|
|
||||||
$this->con = $con;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function insert(DetailPartie $detailPartie)
|
|
||||||
{
|
|
||||||
$query="INSERT INTO DetailPartie VALUES (:idDetailPartie,:joueur,:partie,:enigme,:pointsObtenus,:classement)";
|
|
||||||
$this->con->executeQuery($query,array(
|
|
||||||
'idDetailPartie' => array($detailPartie->getIdDetailPartie(),PDO::PARAM_STR),
|
|
||||||
'joueur' => array($detailPartie->getJoueur(),PDO::PARAM_STR),
|
|
||||||
'partie' => array($detailPartie->getPartie(),PDO::PARAM_STR),
|
|
||||||
'enigme' => array($detailPartie->getEnigme(),PDO::PARAM_STR),
|
|
||||||
'pointsObtenus' => array($detailPartie->getPointsObtenus(),PDO::PARAM_INT),
|
|
||||||
'classement' => array($detailPartie->getClassement(),PDO::PARAM_INT)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
public function delete(string $partie){
|
|
||||||
$query="DELETE * FROM DetailPartie WHERE partie=:partie";
|
|
||||||
$this->con->executeQuery($query,array(
|
|
||||||
'partie' => array($partie,PDO::PARAM_STR)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
public function showAll(){
|
|
||||||
$query="SELECT * FROM DetailPartie";
|
|
||||||
$this->con->executeQuery($query);
|
|
||||||
$results=$this->con->getResults();
|
|
||||||
foreach($results as $row)
|
|
||||||
{
|
|
||||||
$row['idDetailPartie'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,125 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class DetailPartie
|
|
||||||
{
|
|
||||||
private string $idDetailPartie;
|
|
||||||
private string $joueur;
|
|
||||||
private string $partie;
|
|
||||||
private string $enigme;
|
|
||||||
private int $pointsObtenus;
|
|
||||||
private int $classement;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $idDetailPartie
|
|
||||||
* @param string $joueur
|
|
||||||
* @param string $partie
|
|
||||||
* @param string $enigme
|
|
||||||
* @param int $pointsObtenus
|
|
||||||
* @param int $classement
|
|
||||||
*/
|
|
||||||
public function __construct(string $idDetailPartie, string $joueur, string $partie, string $enigme, int $pointsObtenus, int $classement)
|
|
||||||
{
|
|
||||||
$this->idDetailPartie = $idDetailPartie;
|
|
||||||
$this->joueur = $joueur;
|
|
||||||
$this->partie = $partie;
|
|
||||||
$this->enigme = $enigme;
|
|
||||||
$this->pointsObtenus = $pointsObtenus;
|
|
||||||
$this->classement = $classement;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getIdDetailPartie(): string
|
|
||||||
{
|
|
||||||
return $this->idDetailPartie;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $idDetailPartie
|
|
||||||
*/
|
|
||||||
public function setIdDetailPartie(string $idDetailPartie): void
|
|
||||||
{
|
|
||||||
$this->idDetailPartie = $idDetailPartie;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getJoueur(): string
|
|
||||||
{
|
|
||||||
return $this->joueur;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $joueur
|
|
||||||
*/
|
|
||||||
public function setJoueur(string $joueur): void
|
|
||||||
{
|
|
||||||
$this->joueur = $joueur;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPartie(): string
|
|
||||||
{
|
|
||||||
return $this->partie;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $partie
|
|
||||||
*/
|
|
||||||
public function setPartie(string $partie): void
|
|
||||||
{
|
|
||||||
$this->partie = $partie;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getEnigme(): string
|
|
||||||
{
|
|
||||||
return $this->enigme;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $enigme
|
|
||||||
*/
|
|
||||||
public function setEnigme(string $enigme): void
|
|
||||||
{
|
|
||||||
$this->enigme = $enigme;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getPointsObtenus(): int
|
|
||||||
{
|
|
||||||
return $this->pointsObtenus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $pointsObtenus
|
|
||||||
*/
|
|
||||||
public function setPointsObtenus(int $pointsObtenus): void
|
|
||||||
{
|
|
||||||
$this->pointsObtenus = $pointsObtenus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getClassement(): int
|
|
||||||
{
|
|
||||||
return $this->classement;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $classement
|
|
||||||
*/
|
|
||||||
public function setClassement(int $classement): void
|
|
||||||
{
|
|
||||||
$this->classement = $classement;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue