forked from tom.biard/ScienceQuest
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
595 B
25 lines
595 B
<?php
|
|
|
|
namespace model;
|
|
|
|
class MdlJeu extends MdlBase{
|
|
private JeuGateway $gw;
|
|
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$this->gw = new JeuGateway($this->con);
|
|
}
|
|
|
|
public function getAll(): array{
|
|
$listJeu = [];
|
|
foreach($this->gw->getAll() as $row){
|
|
$listJeu[] = new Jeu($row['id'], $row['nom'], $row['nbrparties']);
|
|
}
|
|
return $listJeu;
|
|
}
|
|
|
|
public function getFromId(int $id): Jeu{
|
|
$row = $this->gw->getFromId($id);
|
|
return new Jeu($row['id'], $row['nom'], $row['nbrparties']);
|
|
}
|
|
} |