src/Sulu/Bundle/PageBundle/Repository/NodeRepository.php
private function loadNodeAndAncestors($uuid, $webspaceKey, $locale, $excludeGhosts, $excludeShadows, $complete)
    {
        $descendants = $this->getMapper()->loadNodeAndAncestors(
            $uuid,
            $locale,
            $webspaceKey,
            $excludeGhosts,
            $excludeShadows
        );
        $descendants = array_reverse($descendants);

        $childTiers = [];
        foreach ($descendants as $descendant) {
            foreach ($descendant->getChildren() as $child) {
                $type = $child->getType();

                if ($excludeShadows && null !== $type && 'shadow' === $type->getName()) {
                    continue;
                }

                if ($excludeGhosts && null !== $type && 'ghost' === $type->getName()) {
                    continue;
                }

                if (!isset($childTiers[$descendant->getUuid()])) {
                    $childTiers[$descendant->getUuid()] = [];
                }
                $childTiers[$descendant->getUuid()][] = $this->prepareNode(
                    $child,
                    $webspaceKey,
                    $locale,
                    1,
                    $complete,
                    $excludeGhosts
                );
            }
        }
        $result = array_shift($childTiers);

        $this->iterateTiers($childTiers, $result);

        return $result;
    }
private function loadNodeAndAncestors($uuid, $webspaceKey, $locale, $excludeGhosts, $excludeShadows, $complete)
    {
        $descendants = $this->getMapper()->loadNodeAndAncestors(
            $uuid,
            $locale,
            $webspaceKey,
            $excludeGhosts,
            $excludeShadows
        );
        $descendants = array_reverse($descendants);

        $childTiers = [];
        foreach ($descendants as $descendant) {
            foreach ($descendant->getChildren() as $child) {
                $type = $child->getType();

                if ($excludeShadows && null !== $type && 'shadow' === $type->getName()) {
                    continue;
                }

                if ($excludeGhosts && null !== $type && 'ghost' === $type->getName()) {
                    continue;
                }

                if (!isset($childTiers[$descendant->getUuid()])) {
                    $childTiers[$descendant->getUuid()] = [];
                }
                $childTiers[$descendant->getUuid()][] = $this->prepareNode(
                    $child,
                    $webspaceKey,
                    $locale,
                    1,
                    $complete,
                    $excludeGhosts
                );
            }
        }
        $result = array_shift($childTiers);

        $this->iterateTiers($childTiers, $result);

        return $result;
    }
private function loadNodeAndAncestors ( $ uuid , $ webspaceKey , $ locale , $ excludeGhosts , $ excludeShadows , $ complete ) { $ descendants = $ this -> getMapper ( ) -> loadNodeAndAncestors ( $ uuid , $ locale , $ webspaceKey , $ excludeGhosts , $ excludeShadows ) ; $ descendants = array_reverse ( $ descendants ) ; $ childTiers = [ ] ; foreach ( $ descendants as $ descendant ) { foreach ( $ descendant -> getChildren ( ) as $ child ) { $ type = $ child -> getType ( ) ; if ( $ excludeShadows && null !== $ type && 'shadow' === $ type -> getName ( ) ) { continue ; } if ( $ excludeGhosts && null !== $ type && 'ghost' === $ type -> getName ( ) ) { continue ; } if ( ! isset ( $ childTiers [ $ descendant -> getUuid ( ) ] ) ) { $ childTiers [ $ descendant -> getUuid ( ) ] = [ ] ; } $ childTiers [ $ descendant -> getUuid ( ) ] [ ] = $ this -> prepareNode ( $ child , $ webspaceKey , $ locale , 1 , $ complete , $ excludeGhosts ) ; } } $ result = array_shift ( $ childTiers ) ; $ this -> iterateTiers ( $ childTiers , $ result ) ; return $ result ; }
Load the node and its ancestors and convert them into a HATEOAS representation.

@param string $uuid
@param string $webspaceKey
@param string $locale
@param bool $excludeGhosts
@param bool $excludeShadows
@param bool $complete

@return array
Load the node and its ancestors and convert them into a HATEOAS representation .