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.
ScienceQuest/project/src/model/gateways/JeuGateway.php

24 lines
578 B

<?php
namespace model;
class JeuGateway
{
private Connection $con;
function __construct(Connection $con) {
$this->con = $con;
}
public function getAll() : array
{
$this->con->executeQuery("SELECT id, nom, nbrparties FROM Jeu;");
return $this->con->getResults();
}
public function getFromId(int $id): array
{
$this->con->executeQuery("SELECT id, nom, nbrparties FROM Jeu WHERE id=:id;",
[':id' => [$id, $this->con::PARAM_INT]]);
return $this->con->getOneResult();
}
}