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

@ -130,7 +130,7 @@ class Artist{
SELECT *
from Artists
where ArtistId = ?
', [$artistId], 'Artist');
', [$artistId], Artist::class);
return $result[0] ?? throw new Exceptions\ArtistNotFoundException();;
}
@ -161,7 +161,7 @@ class Artist{
where a.UrlName = ?
or aan.UrlName = ?
limit 1
', [$artist->UrlName, $artist->UrlName], 'Artist');
', [$artist->UrlName, $artist->UrlName], Artist::class);
if(isset($result[0])){
return $result[0];
@ -178,6 +178,7 @@ class Artist{
from Artists
where ArtistId = ?
', [$this->ArtistId]);
Db::Query('
DELETE
from ArtistAlternateNames