parent
b9c6b6039a
commit
53ea6f172f
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class GameGateway
|
||||
{
|
||||
public static function getGames() : array
|
||||
{
|
||||
// TODO: implémenter requête SQL
|
||||
return array(
|
||||
0 => ["Qui-est-ce ?", "Le qui est-ce...."],
|
||||
1 => ["Kahoot", "Le Kahoot permet..."]
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class JeuGateway
|
||||
{
|
||||
private $con;
|
||||
|
||||
function __construct(Connection $con) {
|
||||
$this->con = $con;
|
||||
}
|
||||
public function getAll() : array
|
||||
{
|
||||
$this->con->executeQuery("SELECT id, nom, nbrparties FROM Jeu;");
|
||||
$listJeu = [];
|
||||
foreach($this->con->getResults() as $row){
|
||||
$listJeu[] = new Jeu($row['id'], $row['nom'], $row['nbrparties']);
|
||||
}
|
||||
return $listJeu;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue