mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Get ebooks in a collection from DB
This commit is contained in:
parent
da68637ba0
commit
b3a173aa91
1 changed files with 8 additions and 4 deletions
|
@ -159,12 +159,16 @@ class Library{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array<Ebook>
|
* @return array<Ebook>
|
||||||
* @throws Exceptions\AppException
|
|
||||||
*/
|
*/
|
||||||
public static function GetEbooksByCollection(string $collection): array{
|
public static function GetEbooksByCollection(string $collection): array{
|
||||||
// Do we have the tag's ebooks cached?
|
$ebooks = Db::Query('
|
||||||
/** @var array<Ebook> */
|
SELECT e.*
|
||||||
return self::GetFromApcu('collection-' . $collection);
|
from Ebooks e inner join Collections c using (EbookId)
|
||||||
|
where c.UrlName = ?
|
||||||
|
order by c.SequenceNumber, e.Title
|
||||||
|
', [$collection], Ebook::class);
|
||||||
|
|
||||||
|
return $ebooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue