* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Adapter\Address; use Address; use PrestaShop\PrestaShop\Core\Domain\Address\Exception\AddressNotFoundException; use PrestaShop\PrestaShop\Core\Domain\Address\ValueObject\AddressId; /** * Provides reusable methods for manufacturer address address command/query handlers * * @deprecated Since 1.7.7 Use AbstractAddressHandler instead */ abstract class AbstractManufacturerAddressHandler { /** * Gets legacy Address * * @param AddressId $addressId * * @return Address * * @throws AddressNotFoundException */ protected function getAddress(AddressId $addressId) { $address = new Address($addressId->getValue()); if ($address->id !== $addressId->getValue()) { throw new AddressNotFoundException(sprintf('Address with id "%s" was not found.', $addressId->getValue())); } return $address; } }