1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-24 09:08:47 +02:00

Nombreux changements mineurs

This commit is contained in:
Yohann
2019-10-04 22:36:23 +02:00
parent 7eba8b542b
commit 57b8f7bdfe
13 changed files with 142 additions and 43 deletions

View File

@ -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()
{