Neos\ContentRepository\Domain\Model\Node::moveVariantOrChild PHP Method

moveVariantOrChild() protected method

Moves the given variant or child node to the destination defined by the given path which is the new path for the originally moved (parent|variant) node
protected moveVariantOrChild ( string $aggregateOriginalPath, string $aggregateDestinationPath, Neos\ContentRepository\Domain\Model\NodeInterface $nodeToMove = null ) : array
$aggregateOriginalPath string
$aggregateDestinationPath string
$nodeToMove Neos\ContentRepository\Domain\Model\NodeInterface
return array NodeVariant and old and new path
    protected function moveVariantOrChild($aggregateOriginalPath, $aggregateDestinationPath, NodeInterface $nodeToMove = null)
    {
        if ($nodeToMove === null) {
            return null;
        }
        $variantOriginalPath = $nodeToMove->getPath();
        $relativePathSegment = NodePaths::getRelativePathBetween($aggregateOriginalPath, $variantOriginalPath);
        $variantDestinationPath = NodePaths::addNodePathSegment($aggregateDestinationPath, $relativePathSegment);
        $this->moveNodeToDestinationPath($nodeToMove, $variantDestinationPath);
        return [$nodeToMove, $variantOriginalPath, $nodeToMove->getPath()];
    }
Node