protected function moveNodeVariantToTargetWorkspace(NodeInterface $node, Workspace $targetWorkspace)
{
$nodeData = $node->getNodeData();
$this->handleShadowNodeData($nodeData, $targetWorkspace, $nodeData);
// Technically this shouldn't be needed but due to doctrines behavior we need it.
if ($nodeData->isRemoved() && $targetWorkspace->getBaseWorkspace() === null) {
$this->nodeDataRepository->remove($nodeData);
return;
}
$nodeData->setMovedTo(null);
$nodeData->setWorkspace($targetWorkspace);
$nodeData->setLastPublicationDateTime($this->now);
$node->setNodeDataIsMatchingContext(null);
$this->nodeService->cleanUpProperties($node);
}