Allow admin to view collection metadata

This commit is contained in:
Alex Cabal 2024-12-14 11:32:02 -06:00
parent bcc2f331bc
commit 23b5c8ef31
8 changed files with 82 additions and 55 deletions

View file

@ -2020,17 +2020,17 @@ class Ebook{
* Queries for books in a collection.
*
* Puts ebooks without a `SequenceNumber` at the end of the list, which is more common in a collection with both published and placeholder ebooks.
*
* @return array<Ebook>
*/
public static function GetAllByCollection(string $collection): array{
public static function GetAllByCollection(int $collectionId): array{
$ebooks = Db::Query('
SELECT e.*
from Ebooks e
inner join CollectionEbooks ce using (EbookId)
inner join Collections c using (CollectionId)
where c.UrlName = ?
where ce.CollectionId = ?
order by ce.SequenceNumber is null, ce.SequenceNumber, e.EbookCreated desc
', [$collection], Ebook::class);
', [$collectionId], Ebook::class);
return $ebooks;
}