Search: Tested changes to single-table search

Updated filters to use single table where needed.
This commit is contained in:
Dan Brown
2025-10-29 12:59:34 +00:00
parent 3fd25bd03e
commit 751934c84a
6 changed files with 61 additions and 11 deletions

View File

@@ -129,11 +129,11 @@ class EntityHydrator
foreach ($entities as $entity) {
if ($entity instanceof Page || $entity instanceof Chapter) {
$key = 'book:' . $entity->getRawAttribute('book_id');
$entity->setAttribute('book', $parentMap[$key] ?? null);
$entity->setRelation('book', $parentMap[$key] ?? null);
}
if ($entity instanceof Page) {
$key = 'chapter:' . $entity->getRawAttribute('chapter_id');
$entity->setAttribute('chapter', $parentMap[$key] ?? null);
$entity->setRelation('chapter', $parentMap[$key] ?? null);
}
}
}