Neos\Neos\Service\PluginService::getNodes PHP Method

getNodes() protected method

Find all nodes of a specific node type
protected getNodes ( array $nodeTypes, ContentContext $context ) : array
$nodeTypes array
$context Neos\Neos\Domain\Service\ContentContext current content context, see class doc comment for details
return array
    protected function getNodes(array $nodeTypes, ContentContext $context)
    {
        $nodes = [];
        $siteNode = $context->getCurrentSiteNode();
        foreach ($this->nodeDataRepository->findByParentAndNodeTypeRecursively($siteNode->getPath(), implode(',', $nodeTypes), $context->getWorkspace()) as $nodeData) {
            $nodes[] = $this->nodeFactory->createFromNodeData($nodeData, $context);
        }
        return $nodes;
    }