public function prefetchHierarchy(ClassMetadata $class, NodeInterface $node, $locale = null)
    {
        $prefetch = $this->collectPrefetchHierarchy($class, $node, $locale);
        if (count($prefetch)) {
            $node->getSession()->getNodes($prefetch);
        }
    }
public function prefetchHierarchy(ClassMetadata $class, NodeInterface $node, $locale = null)
    {
        $prefetch = $this->collectPrefetchHierarchy($class, $node, $locale);
        if (count($prefetch)) {
            $node->getSession()->getNodes($prefetch);
        }
    }
public function prefetchHierarchy ( ClassMetadata $ class , NodeInterface $ node , $ locale = null ) { $ prefetch = $ this -> collectPrefetchHierarchy ( $ class , $ node , $ locale ) ; if ( count ( $ prefetch ) ) { $ node -> getSession ( ) -> getNodes ( $ prefetch ) ; } }
Prefetch all Child mappings and the ParentDocument if annotations exist.

@param ClassMetadata $class  The metadata about the document to know what to do.
@param NodeInterface $node   The node to prefetch parent and childs for.
@param string|null   $locale The locale to also prefetch the translation
child if applicable.
Prefetch all Child mappings and the ParentDocument if annotations exist .