Further refine projects system

This commit is contained in:
Alex Cabal 2024-12-15 22:44:31 -06:00
parent 2449de6f6c
commit 5782d6ca7d
20 changed files with 307 additions and 94 deletions

View file

@ -12,6 +12,7 @@ use function Safe\preg_match;
* @property ?Patron $Patron
* @property ?NewsletterSubscription $NewsletterSubscription
* @property ?Payment $LastPayment
* @property string $DisplayName A string that represent's the `User`'s name, or email, or ID.
*/
class User{
use Traits\Accessor;
@ -33,12 +34,29 @@ class User{
protected string $_Url;
protected ?Patron $_Patron;
protected ?NewsletterSubscription $_NewsletterSubscription;
protected string $_DisplayName;
// *******
// GETTERS
// *******
protected function GetDisplayName(): string{
if(!isset($this->_DisplayName)){
if($this->Name !== null){
$this->_DisplayName = $this->Name;
}
elseif($this->Email !== null){
$this->_DisplayName = $this->Email;
}
else{
$this->_DisplayName = 'User #' . $this->UserId;
}
}
return $this->_DisplayName;
}
protected function GetNewsletterSubscription(): ?NewsletterSubscription{
if(!isset($this->_NewsletterSubscription)){
try{