PrefetchHelper
class PrefetchHelper (View source)
This helper collects information about what nodes will be loaded when creating a document proxy and allows to load them in one go, even for a collection.
The trick is to gather as many paths and UUID as possible to fetch them in a single call. Once the transport cached them, we can use normal PHPCR calls to access them, keeping the code readable.
Methods
Prefetch all mapped ReferenceOne annotations.
Prefetch all Child mappings and the ParentDocument if annotations exist.
Gather all UUIDs to pre-fetch nodes in MANY_TO_ONE mappings.
Gather the parent and all child mappings so they can be fetched in one go.
Details
at line 26
prefetch(DocumentManagerInterface $dm, $nodes, $locale = null)
at line 59
prefetchReferences(ClassMetadata $class, NodeInterface $node)
Prefetch all mapped ReferenceOne annotations.
at line 75
prefetchHierarchy(ClassMetadata $class, NodeInterface $node, string|null $locale = null)
Prefetch all Child mappings and the ParentDocument if annotations exist.
at line 91
array
collectPrefetchReferences(ClassMetadata $class, NodeInterface $node)
Gather all UUIDs to pre-fetch nodes in MANY_TO_ONE mappings.
at line 121
array
collectPrefetchHierarchy(ClassMetadata $class, NodeInterface $node, string|null $locale = null)
Gather the parent and all child mappings so they can be fetched in one go.