/**
* @throws ProductNotFoundException
* @throws InconsistentCriteriaIdsException
*/
private function validateProduct(string
$productId, Context
$context): void
{ $product =
$this->productRepository->
search(new Criteria([$productId]),
$context)->
get($productId);
if (!
$product) { throw new ProductNotFoundException($productId);
} } private function checkVersion(Entity
$entity): void
{ if ($entity->
getVersionId() === Defaults::LIVE_VERSION
) { throw OrderException::
canNotRecalculateLiveVersion($entity->
getUniqueIdentifier());
} } /**
* @throws AddressNotFoundException
* @throws OrderException
* @throws InconsistentCriteriaIdsException
*/