- User now has a reverse fullname parameter

- forgetMe() defined as void
This commit is contained in:
Dave M. 2026-07-14 16:49:44 -04:00
parent 23079e6040
commit 33ff1b5b8c
2 changed files with 8 additions and 3 deletions

View File

@ -80,9 +80,13 @@ abstract class User implements UserInterface {
return password_verify($password, $this->password ?? null); return password_verify($password, $this->password ?? null);
} }
public function fullName() : string public function fullname(bool $reverse = false) : string
{ {
return trim( ( $this->firstName ?? "" ) . " " . ( $this->lastName ?? "" ) ); if (! $this->isLoaded() ) {
return "???";
}
return trim($reverse ? "{$this->lastName}, {$this->firstName}" : "{$this->firstName} {$this->lastName}");
} }
public function loggedIn(?bool $set = null): bool public function loggedIn(?bool $set = null): bool

View File

@ -37,7 +37,8 @@ class Authenticate {
return null; return null;
} }
public function forgetMe() { public function forgetMe() : void
{
$this->cookie->delete("user.id"); $this->cookie->delete("user.id");
$this->session->destroy(); $this->session->destroy();
} }