mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 00:52:03 +01: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