Neos\Neos\Command\NodeCommandControllerPlugin::generateUriPathSegmentsForNode PHP Method

generateUriPathSegmentsForNode() protected method

Traverses through the tree starting at the given root node and sets the uriPathSegment property derived from the node label.
protected generateUriPathSegmentsForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, boolean $dryRun ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node where the traversal starts
$dryRun boolean
return void
    protected function generateUriPathSegmentsForNode(NodeInterface $node, $dryRun)
    {
        if ((string) $node->getProperty('uriPathSegment') === '') {
            $name = $node->getLabel() ?: $node->getName();
            $uriPathSegment = $this->nodeUriPathSegmentGenerator->generateUriPathSegment($node);
            if ($dryRun === false) {
                $node->setProperty('uriPathSegment', $uriPathSegment);
                $this->output->outputLine('Added missing URI path segment for "%s" (%s) => %s', array($node->getPath(), $name, $uriPathSegment));
            } else {
                $this->output->outputLine('Found missing URI path segment for "%s" (%s) => %s', array($node->getPath(), $name, $uriPathSegment));
            }
        }
        foreach ($node->getChildNodes('Neos.Neos:Document') as $childNode) {
            $this->generateUriPathSegmentsForNode($childNode, $dryRun);
        }
    }