src/Sulu/Bundle/PageBundle/Controller/NodeController.php
private function getTreeForUuid(Request $request, $id)
    {
        $language = $this->getLanguage($request);
        $webspace = $this->getWebspace($request, false);
        $excludeGhosts = $this->getBooleanRequestParameter($request, 'exclude-ghosts', false, false);
        $excludeShadows = $this->getBooleanRequestParameter($request, 'exclude-shadows', false, false);

        try {
            if (null !== $id && '' !== $id) {
                $result = $this->getRepository()->getNodesTree(
                    $id,
                    $webspace,
                    $language,
                    $excludeGhosts,
                    $excludeShadows
                );
            } elseif (null !== $webspace) {
                $result = $this->getRepository()->getWebspaceNode($webspace, $language);
            } else {
                $result = $this->getRepository()->getWebspaceNodes($language);
            }
        } catch (DocumentNotFoundException $ex) {
            // TODO return 404 and handle this edge case on client side
            return $this->redirect(
                $this->generateUrl(
                    'get_nodes',
                    [
                        'tree' => 'false',
                        'depth' => 1,
                        'language' => $language,
                        'webspace' => $webspace,
                        'exclude-ghosts' => $excludeGhosts,
                    ]
                )
            );
        }

        return $this->handleView(
            $this->view($result)
        );
    }
private function getTreeForUuid(Request $request, $id)
    {
        $language = $this->getLanguage($request);
        $webspace = $this->getWebspace($request, false);
        $excludeGhosts = $this->getBooleanRequestParameter($request, 'exclude-ghosts', false, false);
        $excludeShadows = $this->getBooleanRequestParameter($request, 'exclude-shadows', false, false);

        try {
            if (null !== $id && '' !== $id) {
                $result = $this->getRepository()->getNodesTree(
                    $id,
                    $webspace,
                    $language,
                    $excludeGhosts,
                    $excludeShadows
                );
            } elseif (null !== $webspace) {
                $result = $this->getRepository()->getWebspaceNode($webspace, $language);
            } else {
                $result = $this->getRepository()->getWebspaceNodes($language);
            }
        } catch (DocumentNotFoundException $ex) {
            // TODO return 404 and handle this edge case on client side
            return $this->redirect(
                $this->generateUrl(
                    'get_nodes',
                    [
                        'tree' => 'false',
                        'depth' => 1,
                        'language' => $language,
                        'webspace' => $webspace,
                        'exclude-ghosts' => $excludeGhosts,
                    ]
                )
            );
        }

        return $this->handleView(
            $this->view($result)
        );
    }
private function getTreeForUuid ( Request $ request , $ id ) { $ language = $ this -> getLanguage ( $ request ) ; $ webspace = $ this -> getWebspace ( $ request , false ) ; $ excludeGhosts = $ this -> getBooleanRequestParameter ( $ request , 'exclude-ghosts' , false , false ) ; $ excludeShadows = $ this -> getBooleanRequestParameter ( $ request , 'exclude-shadows' , false , false ) ; try { if ( null !== $ id && '' !== $ id ) { $ result = $ this -> getRepository ( ) -> getNodesTree ( $ id , $ webspace , $ language , $ excludeGhosts , $ excludeShadows ) ; } elseif ( null !== $ webspace ) { $ result = $ this -> getRepository ( ) -> getWebspaceNode ( $ webspace , $ language ) ; } else { $ result = $ this -> getRepository ( ) -> getWebspaceNodes ( $ language ) ; } } catch ( DocumentNotFoundException $ ex ) { // TODO return 404 and handle this edge case on client side return $ this -> redirect ( $ this -> generateUrl ( 'get_nodes' , [ 'tree' => 'false' , 'depth' => 1 , 'language' => $ language , 'webspace' => $ webspace , 'exclude-ghosts' => $ excludeGhosts , ] ) ) ; } return $ this -> handleView ( $ this -> view ( $ result ) ) ; }
Returns a tree along the given path with the siblings of all nodes on the path.
This functionality is required for preloading the content navigation.

@param Request $request
@param string $id

@return \Symfony\Component\HttpFoundation\Response
Returns a tree along the given path with the siblings of all nodes on the path . This functionality is required for preloading the content navigation .