/**
* Materializes the original node data (of a different workspace) into the current
* workspace.
*
* @return void
*/
protected function materializeNodeData()
{
$dimensions = $this->context->getTargetDimensionValues();
$newNodeData = new NodeData($this->nodeData->getPath(), $this->context->getWorkspace(), $this->nodeData->getIdentifier(), $dimensions);
$this->nodeDataRepository->add($newNodeData);
$newNodeData->similarize($this->nodeData);
$this->nodeData = $newNodeData;
$this->nodeDataIsMatchingContext = true;
$nodeType = $this->getNodeType();
foreach ($nodeType->getAutoCreatedChildNodes() as $childNodeName => $childNodeConfiguration) {
$childNode = $this->getNode($childNodeName);
if ($childNode instanceof Node && !$childNode->isNodeDataMatchingContext()) {
$childNode->materializeNodeData();
}
}
}