Neos.Neos/Classes/Controller/Service/NodesController.php
public function indexAction($searchTerm = '', array $nodeIdentifiers = [], $workspaceName = 'live', array $dimensions = [], array $nodeTypes = ['Neos.Neos:Document'], NodeInterface $contextNode = null)
    {
        $searchableNodeTypeNames = [];
        foreach ($nodeTypes as $nodeTypeName) {
            if (!$this->nodeTypeManager->hasNodeType($nodeTypeName)) {
                $this->throwStatus(400, sprintf('Unknown node type "%s"', $nodeTypeName));
            }

            $searchableNodeTypeNames[$nodeTypeName] = $nodeTypeName;
            /** @var NodeType $subNodeType */
            foreach ($this->nodeTypeManager->getSubNodeTypes($nodeTypeName, false) as $subNodeTypeName => $subNodeType) {
                $searchableNodeTypeNames[$subNodeTypeName] = $subNodeTypeName;
            }
        }

        $contentContext = $this->createContentContext($workspaceName, $dimensions);
        if ($nodeIdentifiers === []) {
            $nodes = $this->nodeSearchService->findByProperties($searchTerm, $searchableNodeTypeNames, $contentContext, $contextNode);
        } else {
            $nodes = array_filter(
                array_map(function ($identifier) use ($contentContext) {
                    return $contentContext->getNodeByIdentifier($identifier);
                }, $nodeIdentifiers)
            );
        }

        $this->view->assign('nodes', $nodes);
    }
public function indexAction($searchTerm = '', array $nodeIdentifiers = [], $workspaceName = 'live', array $dimensions = [], array $nodeTypes = ['Neos.Neos:Document'], NodeInterface $contextNode = null)
    {
        $searchableNodeTypeNames = [];
        foreach ($nodeTypes as $nodeTypeName) {
            if (!$this->nodeTypeManager->hasNodeType($nodeTypeName)) {
                $this->throwStatus(400, sprintf('Unknown node type "%s"', $nodeTypeName));
            }

            $searchableNodeTypeNames[$nodeTypeName] = $nodeTypeName;
            /** @var NodeType $subNodeType */
            foreach ($this->nodeTypeManager->getSubNodeTypes($nodeTypeName, false) as $subNodeTypeName => $subNodeType) {
                $searchableNodeTypeNames[$subNodeTypeName] = $subNodeTypeName;
            }
        }

        $contentContext = $this->createContentContext($workspaceName, $dimensions);
        if ($nodeIdentifiers === []) {
            $nodes = $this->nodeSearchService->findByProperties($searchTerm, $searchableNodeTypeNames, $contentContext, $contextNode);
        } else {
            $nodes = array_filter(
                array_map(function ($identifier) use ($contentContext) {
                    return $contentContext->getNodeByIdentifier($identifier);
                }, $nodeIdentifiers)
            );
        }

        $this->view->assign('nodes', $nodes);
    }
public function indexAction ( $ searchTerm = '' , array $ nodeIdentifiers = [ ] , $ workspaceName = 'live' , array $ dimensions = [ ] , array $ nodeTypes = [ 'Neos.Neos:Document' ] , NodeInterface $ contextNode = null ) { $ searchableNodeTypeNames = [ ] ; foreach ( $ nodeTypes as $ nodeTypeName ) { if ( ! $ this -> nodeTypeManager -> hasNodeType ( $ nodeTypeName ) ) { $ this -> throwStatus ( 400 , sprintf ( 'Unknown node type "%s"' , $ nodeTypeName ) ) ; } $ searchableNodeTypeNames [ $ nodeTypeName ] = $ nodeTypeName ; /** @var NodeType $subNodeType */ foreach ( $ this -> nodeTypeManager -> getSubNodeTypes ( $ nodeTypeName , false ) as $ subNodeTypeName => $ subNodeType ) { $ searchableNodeTypeNames [ $ subNodeTypeName ] = $ subNodeTypeName ; } } $ contentContext = $ this -> createContentContext ( $ workspaceName , $ dimensions ) ; if ( $ nodeIdentifiers === [ ] ) { $ nodes = $ this -> nodeSearchService -> findByProperties ( $ searchTerm , $ searchableNodeTypeNames , $ contentContext , $ contextNode ) ; } else { $ nodes = array_filter ( array_map ( function ( $ identifier ) use ( $ contentContext ) { return $ contentContext -> getNodeByIdentifier ( $ identifier ) ; } , $ nodeIdentifiers ) ) ; } $ this -> view -> assign ( 'nodes' , $ nodes ) ; }
Shows a list of nodes

@param string $searchTerm An optional search term used for filtering the list of nodes
@param array $nodeIdentifiers An optional list of node identifiers
@param string $workspaceName Name of the workspace to search in, "live" by default
@param array $dimensions Optional list of dimensions and their values which should be used for querying
@param array $nodeTypes A list of node types the list should be filtered by
@param NodeInterface $contextNode a node to use as context for the search
@return string
Shows a list of nodes