mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-24 23:00:29 +02:00
Nombreux changements mineurs
This commit is contained in:
@ -8,6 +8,8 @@ class User
|
||||
public $surname;
|
||||
public $first_name;
|
||||
public $school;
|
||||
public $city;
|
||||
public $country;
|
||||
public $class;
|
||||
public $description;
|
||||
private $role;
|
||||
@ -88,6 +90,8 @@ class User
|
||||
$this->surname = $data["surname"];
|
||||
$this->first_name = $data["first_name"];
|
||||
$this->school = $data["school"];
|
||||
$this->city = $data["city"];
|
||||
$this->country = $data["country"];
|
||||
$this->class = SchoolClass::fromName($data["class"]);
|
||||
$this->description = $data["description"];
|
||||
$this->role = Role::fromName($data["role"]);
|
||||
@ -157,17 +161,41 @@ class User
|
||||
$DB->prepare("UPDATE `users` SET `first_name` = ? WHERE `id` = ?;")->execute([$first_name, $this->getId()]);
|
||||
}
|
||||
|
||||
public function getSchool()
|
||||
{
|
||||
return $this->school;
|
||||
}
|
||||
public function getSchool()
|
||||
{
|
||||
return $this->school;
|
||||
}
|
||||
|
||||
public function setSchool($school)
|
||||
{
|
||||
global $DB;
|
||||
$this->school = $school;
|
||||
$DB->prepare("UPDATE `users` SET `school` = ? WHERE `id` = ?;")->execute([$school, $this->getId()]);
|
||||
}
|
||||
public function setSchool($school)
|
||||
{
|
||||
global $DB;
|
||||
$this->school = $school;
|
||||
$DB->prepare("UPDATE `users` SET `school` = ? WHERE `id` = ?;")->execute([$school, $this->getId()]);
|
||||
}
|
||||
|
||||
public function getCity()
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
public function setCity($city)
|
||||
{
|
||||
global $DB;
|
||||
$this->city = $city;
|
||||
$DB->prepare("UPDATE `users` SET `city` = ? WHERE `id` = ?;")->execute([$city, $this->getId()]);
|
||||
}
|
||||
|
||||
public function getCountry()
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
public function setCountry($country)
|
||||
{
|
||||
global $DB;
|
||||
$this->country = $country;
|
||||
$DB->prepare("UPDATE `users` SET `country` = ? WHERE `id` = ?;")->execute([$country, $this->getId()]);
|
||||
}
|
||||
|
||||
public function getClass()
|
||||
{
|
||||
|
Reference in New Issue
Block a user