mirror of
https://github.com/standardebooks/web.git
synced 2025-07-22 23:34:48 -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
|
@ -63,12 +63,14 @@ try{
|
|||
}
|
||||
|
||||
if($queryEbookUrl !== null){
|
||||
$artworks = Db::Query('SELECT * from Artworks where EbookUrl = ? and Status = ? limit 1', [$queryEbookUrl, ArtworkStatus::Approved], 'Artwork');
|
||||
$artworks = Db::Query('SELECT * from Artworks where EbookUrl = ? and Status = ? limit 1', [$queryEbookUrl, ArtworkStatus::Approved], Artwork::class);
|
||||
$totalArtworkCount = sizeof($artworks);
|
||||
}
|
||||
else{
|
||||
$result = Library::FilterArtwork($query, $filterArtworkStatus, $sort, $submitterUserId, $page, $perPage);
|
||||
/** @var array<Artwork> $artworks */
|
||||
$artworks = $result['artworks'];
|
||||
/** @var int $totalArtworkCount */
|
||||
$totalArtworkCount = $result['artworksCount'];
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ $pastPolls = Db::Query('
|
|||
from Polls
|
||||
where utc_timestamp() >= end
|
||||
order by Start desc
|
||||
', [], 'Poll');
|
||||
', [], Poll::class);
|
||||
|
||||
$openPolls = Db::Query('
|
||||
SELECT *
|
||||
|
@ -15,7 +15,7 @@ $openPolls = Db::Query('
|
|||
(Start is null
|
||||
or Start <= utc_timestamp())
|
||||
order by Start desc
|
||||
', [], 'Poll');
|
||||
', [], Poll::class);
|
||||
|
||||
?><?= Template::Header(['title' => 'Polls', 'highlight' => '', 'description' => 'The various polls active at Standard Ebooks.']) ?>
|
||||
<main>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue