diff --git a/src/PersistentData/Model/User.php b/src/PersistentData/Model/User.php index e619b65..6928072 100644 --- a/src/PersistentData/Model/User.php +++ b/src/PersistentData/Model/User.php @@ -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;