public function removeContentDimensionsFromRootAndSitesNode($workspaceName, $dryRun) { $workspace = $this->workspaceRepository->findByIdentifier($workspaceName); $rootNodes = $this->nodeDataRepository->findByPath('/', $workspace); $sitesNodes = $this->nodeDataRepository->findByPath('/sites', $workspace); $this->output->outputLine('Checking for root and site nodes with content dimensions set ...'); /** @var \Neos\ContentRepository\Domain\Model\NodeData $rootNode */ foreach ($rootNodes as $rootNode) { if ($rootNode->getDimensionValues() !== []) { if ($dryRun === false) { $rootNode->setDimensions([]); $this->nodeDataRepository->update($rootNode); $this->output->outputLine('Removed content dimensions from root node'); } else { $this->output->outputLine('Found root node with content dimensions set.'); } } } /** @var \Neos\ContentRepository\Domain\Model\NodeData $sitesNode */ foreach ($sitesNodes as $sitesNode) { if ($sitesNode->getDimensionValues() !== []) { if ($dryRun === false) { $sitesNode->setDimensions([]); $this->nodeDataRepository->update($sitesNode); $this->output->outputLine('Removed content dimensions from node "/sites"'); } else { $this->output->outputLine('Found node "/sites"'); } } } }