From eec7dfb0691285df1ae6ab98a72b66d5b4bc823f Mon Sep 17 00:00:00 2001 From: anperederi Date: Fri, 17 Nov 2023 09:08:54 +0100 Subject: [PATCH] :wrench: :pushpin: Downgrade User.php to php7 --- Sources/src/data/model/User.php | 51 ++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/Sources/src/data/model/User.php b/Sources/src/data/model/User.php index 3937d77b..3cfccc65 100644 --- a/Sources/src/data/model/User.php +++ b/Sources/src/data/model/User.php @@ -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}]"; } - + } \ No newline at end of file