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

Amélioration du code de la page "Tournoi"

This commit is contained in:
galaxyoyo
2019-09-10 01:34:41 +02:00
parent cca62a99d0
commit bf83e6534d
4 changed files with 125 additions and 85 deletions

View File

@ -279,6 +279,26 @@ class Tournament
return false;
}
public function addOrganizer(User $user)
{
global $DB;
$this->organizers[] = $user;
$req = $DB->prepare("INSERT INTO `organizers`(`organizer`, `tournament`) VALUES(?, ?);");
$req->execute([$user->getId(), $this->id]);
}
public function clearOrganizers()
{
global $DB;
$this->organizers = [];
$req = $DB->prepare("DELETE FROM `organizers` WHERE `tournament` = ?;");
$req->execute([$this->id]);
}
public function getYear()
{
return $this->year;