mirror of
https://github.com/standardebooks/web.git
synced 2025-07-09 16:20:27 -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
|
@ -158,7 +158,7 @@ class Artwork{
|
|||
from Tags t
|
||||
inner join ArtworkTags at using (TagId)
|
||||
where ArtworkId = ?
|
||||
', [$this->ArtworkId], 'ArtworkTag');
|
||||
', [$this->ArtworkId], ArtworkTag::class);
|
||||
}
|
||||
|
||||
return $this->_Tags;
|
||||
|
@ -849,7 +849,7 @@ class Artwork{
|
|||
SELECT *
|
||||
from Artworks
|
||||
where ArtworkId = ?
|
||||
', [$artworkId], 'Artwork');
|
||||
', [$artworkId], Artwork::class);
|
||||
|
||||
return $result[0] ?? throw new Exceptions\ArtworkNotFoundException();
|
||||
}
|
||||
|
@ -867,7 +867,7 @@ class Artwork{
|
|||
from Artworks
|
||||
inner join Artists using (ArtistId)
|
||||
where Artists.UrlName = ? and Artworks.UrlName = ?
|
||||
', [$artistUrlName, $artworkUrlName], 'Artwork');
|
||||
', [$artistUrlName, $artworkUrlName], Artwork::class);
|
||||
|
||||
return $result[0] ?? throw new Exceptions\ArtworkNotFoundException();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue