66 throw new \Magento\Framework\Exception\NoSuchEntityException(
74 $this->addressRepository->getById(
$addressData->getCustomerAddressId());
75 }
catch (NoSuchEntityException $e) {
76 throw new \Magento\Framework\Exception\NoSuchEntityException(
81 $applicableAddressIds = array_map(
function (
$address) {
84 }, $this->customerRepository->getById(
$addressData->getCustomerId())->getAddresses());
85 if (!in_array(
$addressData->getCustomerAddressId(), $applicableAddressIds)) {
86 throw new \Magento\Framework\Exception\NoSuchEntityException(
87 __(
'Invalid customer address id %1',
$addressData->getCustomerAddressId())
__construct(\Magento\Customer\Api\AddressRepositoryInterface $addressRepository, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, \Magento\Customer\Model\Session $customerSession)