Use static class names instead of strings when getting objects from the DB

This commit is contained in:
Alex Cabal 2024-05-13 13:44:04 -05:00
parent a442f92e28
commit acb6b2949f
16 changed files with 36 additions and 34 deletions

View file

@ -93,7 +93,7 @@ class Patron{
SELECT *
from Patrons
where UserId = ?
', [$userId], 'Patron');
', [$userId], Patron::class);
return $result[0] ?? throw new Exceptions\PatronNotFoundException();;
}
@ -111,7 +111,7 @@ class Patron{
from Patrons p
inner join Users u using(UserId)
where u.Email = ?
', [$email], 'Patron');
', [$email], Patron::class);
return $result[0] ?? throw new Exceptions\PatronNotFoundException();
}