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

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

Internal method, used by Node::setPath
public findByPathWithoutReduce ( string $path, Workspace $workspace, boolean $includeRemovedNodes = false, boolean $recursive = false ) : array
$path string
$workspace Neos\ContentRepository\Domain\Model\Workspace
$includeRemovedNodes boolean Should removed nodes be included in the result (defaults to FALSE)
$recursive boolean
Результат array
    public function findByPathWithoutReduce($path, Workspace $workspace, $includeRemovedNodes = false, $recursive = false)
    {
        $path = strtolower($path);
        $workspaces = $this->collectWorkspaceAndAllBaseWorkspaces($workspace);
        $queryBuilder = $this->createQueryBuilder($workspaces);
        $this->addPathConstraintToQueryBuilder($queryBuilder, $path, $recursive);
        $query = $queryBuilder->getQuery();
        $foundNodes = $query->getResult();
        // Consider materialized, but not yet persisted nodes
        foreach ($this->addedNodes as $addedNode) {
            if (($addedNode->getPath() === $path || $recursive && NodePaths::isSubPathOf($path, $addedNode->getPath())) && in_array($addedNode->getWorkspace(), $workspaces)) {
                $foundNodes[] = $addedNode;
            }
        }
        $foundNodes = $this->reduceNodeVariantsByWorkspaces($foundNodes, $workspaces);
        if ($includeRemovedNodes === false) {
            $foundNodes = $this->filterRemovedNodes($foundNodes, false);
        }
        return $foundNodes;
    }

Usage Example

 /**
  * Tests addPathConstraintToQueryBuilder, see https://jira.neos.io/browse/NEOS-1849
  *
  * @test
  */
 public function findByPathWithoutReduceLimitsToRootNodeCorrectly()
 {
     $this->setUpNodes();
     $workspace = $this->context->getWorkspace();
     $foundNodes = $this->nodeDataRepository->findByPathWithoutReduce('/', $workspace, false, true);
     $this->assertCount(7, $foundNodes);
 }
All Usage Examples Of Neos\ContentRepository\Domain\Repository\NodeDataRepository::findByPathWithoutReduce