src/Sulu/Bundle/PageBundle/Repository/NodeRepository.php
private function createWebspaceNode(
        $webspaceKey,
        $languageCode,
        $depth = 1,
        $excludeGhosts = false
    ) {
        $webspace = $this->webspaceManager->getWebspaceCollection()->getWebspace($webspaceKey);

        if ($depth > 0) {
            $nodes = $this->getMapper()->loadByParent(
                null,
                $webspaceKey,
                $languageCode,
                $depth,
                false,
                false,
                $excludeGhosts
            );
            $embedded = $this->prepareNodesTree($nodes, $webspaceKey, $languageCode, true, $excludeGhosts, $depth);
        } else {
            $embedded = [];
        }

        return [
            'id' => $this->sessionManager->getContentNode($webspace->getKey())->getIdentifier(),
            'path' => '/',
            'title' => $webspace->getName(),
            'hasSub' => true,
            'publishedState' => true,
            '_embedded' => $embedded,
            '_links' => [
                'children' => [
                    'href' => $this->apiBasePath . '?depth=' . $depth . '&webspace=' . $webspaceKey .
                        '&language=' . $languageCode . (true === $excludeGhosts ? '&exclude-ghosts=true' : ''),
                ],
            ],
        ];
    }
private function createWebspaceNode(
        $webspaceKey,
        $languageCode,
        $depth = 1,
        $excludeGhosts = false
    ) {
        $webspace = $this->webspaceManager->getWebspaceCollection()->getWebspace($webspaceKey);

        if ($depth > 0) {
            $nodes = $this->getMapper()->loadByParent(
                null,
                $webspaceKey,
                $languageCode,
                $depth,
                false,
                false,
                $excludeGhosts
            );
            $embedded = $this->prepareNodesTree($nodes, $webspaceKey, $languageCode, true, $excludeGhosts, $depth);
        } else {
            $embedded = [];
        }

        return [
            'id' => $this->sessionManager->getContentNode($webspace->getKey())->getIdentifier(),
            'path' => '/',
            'title' => $webspace->getName(),
            'hasSub' => true,
            'publishedState' => true,
            '_embedded' => $embedded,
            '_links' => [
                'children' => [
                    'href' => $this->apiBasePath . '?depth=' . $depth . '&webspace=' . $webspaceKey .
                        '&language=' . $languageCode . (true === $excludeGhosts ? '&exclude-ghosts=true' : ''),
                ],
            ],
        ];
    }
private function createWebspaceNode ( $ webspaceKey , $ languageCode , $ depth = 1 , $ excludeGhosts = false ) { $ webspace = $ this -> webspaceManager -> getWebspaceCollection ( ) -> getWebspace ( $ webspaceKey ) ; if ( $ depth > 0 ) { $ nodes = $ this -> getMapper ( ) -> loadByParent ( null , $ webspaceKey , $ languageCode , $ depth , false , false , $ excludeGhosts ) ; $ embedded = $ this -> prepareNodesTree ( $ nodes , $ webspaceKey , $ languageCode , true , $ excludeGhosts , $ depth ) ; } else { $ embedded = [ ] ; } return [ 'id' => $ this -> sessionManager -> getContentNode ( $ webspace -> getKey ( ) ) -> getIdentifier ( ) , 'path' => '/' , 'title' => $ webspace -> getName ( ) , 'hasSub' => true , 'publishedState' => true , '_embedded' => $ embedded , '_links' => [ 'children' => [ 'href' => $ this -> apiBasePath . '?depth=' . $ depth . '&webspace=' . $ webspaceKey . '&language=' . $ languageCode . ( true === $ excludeGhosts ? '&exclude-ghosts=true' : '' ) , ] , ] , ] ; }
Creates a webspace node.
Creates a webspace node .