public function collectPrefetchHierarchy(ClassMetadata $class, NodeInterface $node, $locale = null)
    {
        $prefetch = [];
        if ($class->parentMapping && $node->getDepth() > 0) {
            $prefetch[] = PathHelper::getParentPath($node->getPath());
        }
        foreach ($class->childMappings as $fieldName) {
            $childName = $class->mappings[$fieldName]['nodeName'];
            $prefetch[] = PathHelper::absolutizePath($childName, $node->getPath());
        }
        if ($locale && count($prefetch) && 'child' === $class->translator) {
            $prefetch[] = $node->getPath().'/phpcr_locale:'.$locale;
        }

        return $prefetch;
    }
public function collectPrefetchHierarchy(ClassMetadata $class, NodeInterface $node, $locale = null)
    {
        $prefetch = [];
        if ($class->parentMapping && $node->getDepth() > 0) {
            $prefetch[] = PathHelper::getParentPath($node->getPath());
        }
        foreach ($class->childMappings as $fieldName) {
            $childName = $class->mappings[$fieldName]['nodeName'];
            $prefetch[] = PathHelper::absolutizePath($childName, $node->getPath());
        }
        if ($locale && count($prefetch) && 'child' === $class->translator) {
            $prefetch[] = $node->getPath().'/phpcr_locale:'.$locale;
        }

        return $prefetch;
    }
public function collectPrefetchHierarchy ( ClassMetadata $ class , NodeInterface $ node , $ locale = null ) { $ prefetch = [ ] ; if ( $ class -> parentMapping && $ node -> getDepth ( ) > 0 ) { $ prefetch [ ] = PathHelper :: getParentPath ( $ node -> getPath ( ) ) ; } foreach ( $ class -> childMappings as $ fieldName ) { $ childName = $ class -> mappings [ $ fieldName ] [ 'nodeName' ] ; $ prefetch [ ] = PathHelper :: absolutizePath ( $ childName , $ node -> getPath ( ) ) ; } if ( $ locale && count ( $ prefetch ) && 'child' === $ class -> translator ) { $ prefetch [ ] = $ node -> getPath ( ) . '/phpcr_locale:' . $ locale ; } return $ prefetch ; }
Gather the parent and all child mappings so they can be fetched in one
go.

@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.

@return array List of absolute paths to nodes that should be prefetched.
Gather the parent and all child mappings so they can be fetched in one go .