1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 17:37:25 +02:00

Utilisation des nouvelles classes, amélioration du code

This commit is contained in:
galaxyoyo
2019-09-07 01:33:05 +02:00
parent b5d567e364
commit bffaf4b360
30 changed files with 472 additions and 440 deletions

View File

@ -27,7 +27,7 @@ class Tournament
$data = $req->fetch();
if ($data === false)
throw new InvalidArgumentException("Le tournoi spécifié n'existe pas.");
return null;
$tournament = new Tournament();
$tournament->fill($data);
@ -42,7 +42,21 @@ class Tournament
$data = $req->fetch();
if ($data === false)
throw new InvalidArgumentException("Le tournoi spécifié n'existe pas.");
return null;
$tournament = new Tournament();
$tournament->fill($data);
return $tournament;
}
public static function getFinalTournament()
{
global $DB, $YEAR;
$req = $DB->query("SELECT * FROM `tournaments` WHERE `final` AND `year` = $YEAR;");
$data = $req->fetch();
if ($data === false)
return null;
$tournament = new Tournament();
$tournament->fill($data);