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:
@ -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);
|
||||
|
Reference in New Issue
Block a user