feature/username-for-users #70

Merged
bence merged 10 commits from feature/username-for-users into develop 2023-09-25 20:04:50 +02:00
Showing only changes of commit 5b045335a1 - Show all commits

View File

@ -8,12 +8,14 @@ class User extends Model implements IUser
{
protected static string $table = 'users';
protected static array $fields = ['email', 'password', 'type', 'active', 'google_sub', 'created'];
protected static array $fields = ['email', 'username', 'password', 'type', 'active', 'google_sub', 'created'];
private static array $types = ['user', 'admin'];
private string $email = '';
private string $username = '';
private ?string $password = null;
private string $type = 'user';
@ -29,6 +31,11 @@ class User extends Model implements IUser
$this->email = $email;
}
public function setUsername(string $username): void
{
$this->username = $username;
}
public function setPassword(?string $hashedPassword): void
{
$this->password = $hashedPassword;
@ -71,6 +78,11 @@ class User extends Model implements IUser
return $this->email;
}
public function getUsername(): string
{
return $this->username;
}
public function getPassword(): ?string
{
return $this->password;