mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 18:57:23 +02:00
Adaptation de la plateforme aux besoins des correspondances (en cours)
This commit is contained in:
@ -5,12 +5,11 @@ class Team
|
||||
private $id;
|
||||
private $name;
|
||||
private $trigram;
|
||||
private $tournament;
|
||||
private $encadrants;
|
||||
private $problem;
|
||||
private $encadrant;
|
||||
private $participants;
|
||||
private $inscription_date;
|
||||
private $validation_status;
|
||||
private $final_selection;
|
||||
private $access_code;
|
||||
private $year;
|
||||
|
||||
@ -66,12 +65,11 @@ class Team
|
||||
$this->id = $data["id"];
|
||||
$this->name = $data["name"];
|
||||
$this->trigram = $data["trigram"];
|
||||
$this->tournament = $data["tournament"];
|
||||
$this->encadrants = [$data["encadrant_1"], $data["encadrant_2"]];
|
||||
$this->problem = $data["problem"];
|
||||
$this->encadrant = $data["encadrant"];
|
||||
$this->participants = [$data["participant_1"], $data["participant_2"], $data["participant_3"], $data["participant_4"], $data["participant_5"], $data["participant_6"]];
|
||||
$this->inscription_date = $data["inscription_date"];
|
||||
$this->validation_status = ValidationStatus::fromName($data["validation_status"]);
|
||||
$this->final_selection = $data["final_selection"] == true;
|
||||
$this->access_code = $data["access_code"];
|
||||
$this->year = $data["year"];
|
||||
}
|
||||
@ -105,29 +103,29 @@ class Team
|
||||
$DB->prepare("UPDATE `teams` SET `trigram` = ? WHERE `id` = ?;")->execute([$trigram, $this->id]);
|
||||
}
|
||||
|
||||
public function getTournamentId()
|
||||
public function getProblem()
|
||||
{
|
||||
return $this->tournament;
|
||||
return $this->problem;
|
||||
}
|
||||
|
||||
public function setTournamentId($tournament)
|
||||
public function setProblem($problem)
|
||||
{
|
||||
global $DB;
|
||||
$this->tournament = $tournament;
|
||||
$DB->prepare("UPDATE `teams` SET `tournament` = ? WHERE `id` = ?;")->execute([$tournament, $this->id]);
|
||||
$this->problem = $problem;
|
||||
$DB->prepare("UPDATE `teams` SET `problem` = ? WHERE `id` = ?;")->execute([$problem, $this->id]);
|
||||
}
|
||||
|
||||
public function getEncadrants()
|
||||
public function getEncadrantId()
|
||||
{
|
||||
return $this->encadrants;
|
||||
return $this->encadrant;
|
||||
}
|
||||
|
||||
public function setEncadrant($i, $encadrant)
|
||||
public function setEncadrant($encadrant)
|
||||
{
|
||||
global $DB;
|
||||
$this->encadrants[$i - 1] = $encadrant;
|
||||
$this->encadrant = $encadrant;
|
||||
/** @noinspection SqlResolve */
|
||||
$DB->prepare("UPDATE `teams` SET `encadrant_$i` = ? WHERE `id` = ?;")->execute([$encadrant, $this->id]);
|
||||
$DB->prepare("UPDATE `teams` SET `encadrant` = ? WHERE `id` = ?;")->execute([$encadrant, $this->id]);
|
||||
}
|
||||
|
||||
public function getParticipants()
|
||||
@ -161,18 +159,6 @@ class Team
|
||||
$DB->prepare("UPDATE `teams` SET `validation_status` = ? WHERE `id` = ?;")->execute([ValidationStatus::getName($status), $this->id]);
|
||||
}
|
||||
|
||||
public function isSelectedForFinal()
|
||||
{
|
||||
return $this->final_selection;
|
||||
}
|
||||
|
||||
public function selectForFinal($selected)
|
||||
{
|
||||
global $DB;
|
||||
$this->final_selection = $selected;
|
||||
$DB->prepare("UPDATE `teams` SET `final_selection` = ? WHERE `id` = ?;")->execute([$selected, $this->id]);
|
||||
}
|
||||
|
||||
public function getAccessCode()
|
||||
{
|
||||
return $this->access_code;
|
||||
|
Reference in New Issue
Block a user