Skip to content

Commit

Permalink
Don't display books of the same serie because they are already present
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Sep 29, 2023
1 parent caf8dbf commit e99d9f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Repository/BookRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getWithSameAuthors(Book $book, int $maxResults = 6): array
return [];
}

$items = array_filter($results, static fn ($result) => $result->getId() !== $book->getId());
$items = array_filter($results, static fn ($result) => $result->getId() !== $book->getId() && ($result->getSerie() === null || $book->getSerie() !== $result->getSerie()));

if (count($items) === 0) {
return [];
Expand Down

0 comments on commit e99d9f4

Please sign in to comment.