Search: Started work to make search result size consistent

This commit is contained in:
Dan Brown
2025-10-27 17:23:15 +00:00
parent c21c36e2a6
commit 0b26573314
6 changed files with 284 additions and 79 deletions

View File

@@ -471,4 +471,17 @@ abstract class Entity extends Model implements
return $contentFields;
}
/**
* Create a new instance for the given entity type.
*/
public static function instanceFromType(string $type): self
{
return match ($type) {
'page' => new Page(),
'chapter' => new Chapter(),
'book' => new Book(),
'bookshelf' => new Bookshelf(),
};
}
}