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