|
|
|
@ -5,18 +5,41 @@ use Model\Role;
|
|
|
|
|
// Data Class
|
|
|
|
|
|
|
|
|
|
class User{
|
|
|
|
|
private int $id;
|
|
|
|
|
private string $nom;
|
|
|
|
|
private string $prenom;
|
|
|
|
|
private string $email;
|
|
|
|
|
private string $motDePasse;
|
|
|
|
|
private string $sexe;
|
|
|
|
|
private float $taille;
|
|
|
|
|
private float $poids;
|
|
|
|
|
private \DateTime $dateNaissance;
|
|
|
|
|
private Role $role;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
private int $id,
|
|
|
|
|
private string $nom,
|
|
|
|
|
private string $prenom,
|
|
|
|
|
private string $email,
|
|
|
|
|
private string $motDePasse,
|
|
|
|
|
private string $sexe,
|
|
|
|
|
private float $taille,
|
|
|
|
|
private float $poids,
|
|
|
|
|
private \DateTime $dateNaissance,
|
|
|
|
|
private Role $role,
|
|
|
|
|
) {}
|
|
|
|
|
int $id,
|
|
|
|
|
string $nom,
|
|
|
|
|
string $prenom,
|
|
|
|
|
string $email,
|
|
|
|
|
string $motDePasse,
|
|
|
|
|
string $sexe,
|
|
|
|
|
float $taille,
|
|
|
|
|
float $poids,
|
|
|
|
|
\DateTime $dateNaissance,
|
|
|
|
|
Role $role
|
|
|
|
|
) {
|
|
|
|
|
$this->id = $id;
|
|
|
|
|
$this->nom = $nom;
|
|
|
|
|
$this->prenom = $prenom;
|
|
|
|
|
$this->email = $email;
|
|
|
|
|
$this->motDePasse = $motDePasse;
|
|
|
|
|
$this->sexe = $sexe;
|
|
|
|
|
$this->taille = $taille;
|
|
|
|
|
$this->poids = $poids;
|
|
|
|
|
$this->dateNaissance = $dateNaissance;
|
|
|
|
|
$this->role = $role;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getId(): int {
|
|
|
|
|
return $this->id;
|
|
|
|
|
}
|
|
|
|
@ -48,8 +71,8 @@ class User{
|
|
|
|
|
public function setEmail(string $email): void {
|
|
|
|
|
$this->email = $email;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string hashed password used to authenticate the user.
|
|
|
|
|
*/
|
|
|
|
|
public function getMotDePasse(): string {
|
|
|
|
@ -108,5 +131,5 @@ class User{
|
|
|
|
|
public function __toString() {
|
|
|
|
|
return "Athlete [ID: {$this->id}, Nom: {$this->nom}, Prénom: {$this->prenom}, Email: {$this->email}]";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|