mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 15:50:29 -04:00
Use static class names instead of strings when getting objects from the DB
This commit is contained in:
parent
a442f92e28
commit
acb6b2949f
16 changed files with 36 additions and 34 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue