Internal method, used by Node::setPath
public findByPathWithoutReduce ( string $path, |
||
$path | string | |
$workspace | ||
$includeRemovedNodes | boolean | Should removed nodes be included in the result (defaults to FALSE) |
$recursive | boolean | |
리턴 | array |
/** * 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); }
/** * Moves a node and sub nodes to the new path given with special logic for aggregate node types. * * @param string $destinationPath the new node path * @param boolean $recursiveCall is this a recursive call * @return array of arrays with NodeVariant and old and new path and if this was a recursive call */ protected function setPathInternalForAggregate($destinationPath, $recursiveCall) { $originalPath = $this->nodeData->getPath(); $nodeDataVariantsAndChildren = $this->nodeDataRepository->findByPathWithoutReduce($originalPath, $this->context->getWorkspace(), true, true); $changedNodePathsCollection = array_map(function ($nodeData) use($destinationPath, $originalPath, $recursiveCall) { return $this->moveNodeData($nodeData, $originalPath, $destinationPath, $recursiveCall); }, $nodeDataVariantsAndChildren); return array_filter($changedNodePathsCollection); }