/** * Create a node for the given NodeData, given that it is a variant of the current node * * @param NodeData $nodeData * @return Node */ protected function createNodeForVariant($nodeData) { $contextProperties = $this->context->getProperties(); $contextProperties['dimensions'] = $nodeData->getDimensionValues(); unset($contextProperties['targetDimensions']); $adjustedContext = $this->contextFactory->create($contextProperties); return $this->nodeFactory->createFromNodeData($nodeData, $adjustedContext); }