$versionContext =
$context->
createWithVersionId(Defaults::LIVE_VERSION
)->
assign([ 'languageIdChain' =>
array_unique(array_filter([$languageId,
$context->
getLanguageId()])),
]);
$criteria = OrderDocumentCriteriaFactory::
create([$orderId],
$deepLinkCode);
/** @var ?OrderEntity $order */
$order =
$this->orderRepository->
search($criteria,
$versionContext)->
get($orderId);
if ($order === null
) { if (Feature::
isActive('v6.6.0.0'
)) { throw DocumentException::
orderNotFound($orderId);
} throw new InvalidOrderException($orderId);
} return $order;
} private function getNumber(Context
$context, OrderEntity
$order, DocumentGenerateOperation
$operation): string
{ return $this->numberRangeValueGenerator->
getValue(