Neos.ContentRepository/Classes/Domain/Model/Node.php
protected function setPath(string $path, bool $checkForExistence = true): void
    {
        $originalPath = $this->nodeData->getPath();
        if ($originalPath === $path) {
            return;
        }

        $pathAvailable = $checkForExistence ? $this->isNodePathAvailable($path) : true;
        if (!$pathAvailable) {
            throw new NodeException(sprintf('Can not rename the node "%s" as a node already exists on path "%s"', $this->getPath(), $path), 1414436551);
        }

        $changedNodePathsCollection = $this->setPathInternal($path, !$checkForExistence);
        $this->nodeDataRepository->persistEntities();
        array_walk($changedNodePathsCollection, function ($changedNodePathInformation) {
            call_user_func_array([
                $this,
                'emitNodePathChanged'
            ], $changedNodePathInformation);
        });
    }
protected function setPath(string $path, bool $checkForExistence = true): void
    {
        $originalPath = $this->nodeData->getPath();
        if ($originalPath === $path) {
            return;
        }

        $pathAvailable = $checkForExistence ? $this->isNodePathAvailable($path) : true;
        if (!$pathAvailable) {
            throw new NodeException(sprintf('Can not rename the node "%s" as a node already exists on path "%s"', $this->getPath(), $path), 1414436551);
        }

        $changedNodePathsCollection = $this->setPathInternal($path, !$checkForExistence);
        $this->nodeDataRepository->persistEntities();
        array_walk($changedNodePathsCollection, function ($changedNodePathInformation) {
            call_user_func_array([
                $this,
                'emitNodePathChanged'
            ], $changedNodePathInformation);
        });
    }
protected function setPath ( string $ path , bool $ checkForExistence = true ) : void { $ originalPath = $ this -> nodeData -> getPath ( ) ; if ( $ originalPath === $ path ) { return ; } $ pathAvailable = $ checkForExistence ? $ this -> isNodePathAvailable ( $ path ) : true ; if ( ! $ pathAvailable ) { throw new NodeException ( sprintf ( 'Can not rename the node "%s" as a node already exists on path "%s"' , $ this -> getPath ( ) , $ path ) , 1414436551 ) ; } $ changedNodePathsCollection = $ this -> setPathInternal ( $ path , ! $ checkForExistence ) ; $ this -> nodeDataRepository -> persistEntities ( ) ; array_walk ( $ changedNodePathsCollection , function ( $ changedNodePathInformation ) { call_user_func_array ( [ $ this , 'emitNodePathChanged' ] , $ changedNodePathInformation ) ; } ) ; }
Sets the absolute path of this node.

This method is only for internal use by the content repository or node methods. Changing
the path of a node manually may lead to unexpected behavior.

To achieve a correct behavior when changing the path (moving the node) in a workspace, a shadow node data that will
hide the node data in the base workspace will be created. Thus queries do not need to worry about moved nodes.
Through a movedTo reference the shadow node data will be removed when publishing the moved node.

@param string $path
@param boolean $checkForExistence Checks for existence at target path, internally used for recursions and shadow nodes.
@return void
@throws NodeException
@throws NodeTypeNotFoundException
Sets the absolute path of this node .