added getters & setters

This commit is contained in:
tracer 2022-10-23 12:43:50 +02:00
parent 4a85f45e3a
commit a3b2bf27f1
1 changed files with 87 additions and 6 deletions

View File

@ -1,18 +1,99 @@
<?php
/*
* Copyright (c) 2022. Micha Espey <tracer@24unix.net>
*
* 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;
}
}