Neos\ContentRepository\Domain\Repository\NodeDataRepository::findByParentAndNodeTypeRecursively PHP Метод

findByParentAndNodeTypeRecursively() публичный Метод

Finds recursively nodes by its parent and (optionally) by its node type.
См. также: findByParentAndNodeType()
public findByParentAndNodeTypeRecursively ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $removedNodes = false ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array An array of dimensions to dimension values
$removedNodes boolean If TRUE the result has ONLY removed nodes. If FALSE removed nodes are NOT inside the result. If NULL the result contains BOTH removed and non-removed nodes. (defaults to FALSE)
Результат array<\Neos\ContentRepository\Domain\Model\NodeData>
    public function findByParentAndNodeTypeRecursively($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $removedNodes = false)
    {
        return $this->findByParentAndNodeType($parentPath, $nodeTypeFilter, $workspace, $dimensions, $removedNodes, true);
    }

Usage Example

 /**
  * Find all nodes of a specific node type
  *
  * @param array $nodeTypes
  * @param ContentContext $context current content context, see class doc comment for details
  * @return array<NodeInterface> all nodes of type $nodeType in the current $context
  */
 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;
 }
All Usage Examples Of Neos\ContentRepository\Domain\Repository\NodeDataRepository::findByParentAndNodeTypeRecursively