From a3b2bf27f1106b9ecd9daf6cf39ec338cd4e930c Mon Sep 17 00:00:00 2001 From: tracer Date: Sun, 23 Oct 2022 12:43:50 +0200 Subject: [PATCH] added getters & setters --- src/Entity/User.php | 93 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 6 deletions(-) diff --git a/src/Entity/User.php b/src/Entity/User.php index cc21b3e..e004bea 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -1,18 +1,99 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace App\Entity; +use App\Enums\UserAuth; + class User { public function __construct( - private string $nick, - private string $password, - private string $first = '', - private string $last = '', - private int $id = 0, - private bool $isAdmin = false + private string $nick = '', + private string $password = '', + private string $first = '', + private string $last = '', + private int $id = 0, + private bool $isAdmin = false, + private UserAuth $userAuth = UserAuth::AUTH_ANONYMOUS ) { // empty body } + + public function getNick(): string + { + return $this->nick; + } + + public function setNick(string $nick): void + { + $this->nick = $nick; + } + + public function getPassword(): string + { + return $this->password; + } + + public function setPassword(string $password): void + { + $this->password = $password; + } + + public function getFirst(): string + { + return $this->first; + } + + public function setFirst(string $first): void + { + $this->first = $first; + } + + public function getLast(): string + { + return $this->last; + } + + public function setLast(string $last): void + { + $this->last = $last; + } + + public function getId(): int + { + return $this->id; + } + + public function setId(int $id): void + { + $this->id = $id; + } + + public function isAdmin(): bool + { + return $this->isAdmin; + } + + public function setIsAdmin(bool $isAdmin): void + { + $this->isAdmin = $isAdmin; + } + + public function getAuth() + { + return UserAuth::AUTH_ANONYMOUS; + } + + public function setAuth(UserAuth $userAuth) + { + $this->userAuth = $userAuth; + } + } \ No newline at end of file