diff --git a/lib/Ebook.php b/lib/Ebook.php index 54c504bf..1c0dea48 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -2280,9 +2280,9 @@ final class Ebook{ } /** - * Queries for books in a collection. + * Get `Ebook`s 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. + * Puts `Ebook`s without a `SequenceNumber` at the end of the list, which is more common in a collection with both published and placeholder ebooks. * * @return array */ @@ -2299,9 +2299,10 @@ final class Ebook{ } /** - * Queries for related to books to be shown, e.g., in a carousel. + * Get related `Ebook`s, e.g., in a carousel. + * + * Does not include `EbookPlaceholder`s, because they're not useful for browsing. * - * Filters out placeholder books because they are not useful for browsing. * @return array */ public static function GetAllByRelated(Ebook $ebook, int $count, ?EbookTag $relatedTag): array{ @@ -2331,6 +2332,17 @@ final class Ebook{ return $relatedEbooks; } + /** + * Get all `Ebook`s in a set of `EbookId`s. + * + * @param array $ebookIds + * + * @return array + */ + public static function GetAllBySet(array $ebookIds): array{ + return Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSql($ebookIds), $ebookIds, Ebook::class); + } + /** * @param array $tags * diff --git a/www/blog/a-kind-of-bolshevism-in-an-uncanny-bookshop.php b/www/blog/a-kind-of-bolshevism-in-an-uncanny-bookshop.php index c93d9190..a347c077 100644 --- a/www/blog/a-kind-of-bolshevism-in-an-uncanny-bookshop.php +++ b/www/blog/a-kind-of-bolshevism-in-an-uncanny-bookshop.php @@ -1,6 +1,5 @@
diff --git a/www/blog/death-and-beauty-in-the-alps.php b/www/blog/death-and-beauty-in-the-alps.php index a620cf48..ea64a9f3 100644 --- a/www/blog/death-and-beauty-in-the-alps.php +++ b/www/blog/death-and-beauty-in-the-alps.php @@ -1,6 +1,5 @@
diff --git a/www/blog/edith-whartons-vision-of-literary-art.php b/www/blog/edith-whartons-vision-of-literary-art.php index 4f845a31..2366bd8e 100644 --- a/www/blog/edith-whartons-vision-of-literary-art.php +++ b/www/blog/edith-whartons-vision-of-literary-art.php @@ -1,6 +1,5 @@
diff --git a/www/blog/joyces-ulysses-the-rubaiyat-and-yes.php b/www/blog/joyces-ulysses-the-rubaiyat-and-yes.php index 4867c01e..5b2d72bc 100644 --- a/www/blog/joyces-ulysses-the-rubaiyat-and-yes.php +++ b/www/blog/joyces-ulysses-the-rubaiyat-and-yes.php @@ -1,6 +1,5 @@
diff --git a/www/blog/of-human-bondage-spinoza-and-the-meaning-of-life.php b/www/blog/of-human-bondage-spinoza-and-the-meaning-of-life.php index ee9f9a5a..c63cd5c1 100644 --- a/www/blog/of-human-bondage-spinoza-and-the-meaning-of-life.php +++ b/www/blog/of-human-bondage-spinoza-and-the-meaning-of-life.php @@ -1,6 +1,5 @@
diff --git a/www/blog/the-ugly-duckling-and-the-carmelite-in-middlemarch.php b/www/blog/the-ugly-duckling-and-the-carmelite-in-middlemarch.php index 9fdcebec..acfbadf7 100644 --- a/www/blog/the-ugly-duckling-and-the-carmelite-in-middlemarch.php +++ b/www/blog/the-ugly-duckling-and-the-carmelite-in-middlemarch.php @@ -1,6 +1,5 @@