Style tweaks for getters and add more type hinting

This commit is contained in:
Alex Cabal 2024-04-30 22:45:20 -05:00
parent 9e31ed1aac
commit 50efeb05d1
13 changed files with 87 additions and 84 deletions

View file

@ -132,6 +132,9 @@ class NewsletterSubscription extends Accessor{
// ORM METHODS
// ***********
/**
* @throws Exceptions\NewsletterSubscriptionNotFoundException
*/
public static function Get(?string $uuid): NewsletterSubscription{
if($uuid === null){
throw new Exceptions\NewsletterSubscriptionNotFoundException();
@ -144,10 +147,6 @@ class NewsletterSubscription extends Accessor{
where u.Uuid = ?
', [$uuid], 'NewsletterSubscription');
if(sizeof($result) == 0){
throw new Exceptions\NewsletterSubscriptionNotFoundException();
}
return $result[0];
return $result[0] ?? throw new Exceptions\NewsletterSubscriptionNotFoundException();
}
}