/**
* Returns the NodeData instance with the given identifier from the target workspace.
* If no NodeData instance is found, null is returned.
*
* @param NodeInterface $node
* @param Workspace $targetWorkspace
* @return NodeData
*/
protected function findNodeDataInTargetWorkspace(NodeInterface $node, Workspace $targetWorkspace)
{
$nodeData = $this->nodeDataRepository->findOneByIdentifier($node->getIdentifier(), $targetWorkspace, $node->getDimensions());
return $nodeData === null || $nodeData->getWorkspace() === $targetWorkspace ? $nodeData : null;
}