AddressRepositoryInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Customer\Api;
  8. /**
  9. * Customer address CRUD interface.
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface AddressRepositoryInterface
  14. {
  15. /**
  16. * Save customer address.
  17. *
  18. * @param \Magento\Customer\Api\Data\AddressInterface $address
  19. * @return \Magento\Customer\Api\Data\AddressInterface
  20. * @throws \Magento\Framework\Exception\LocalizedException
  21. */
  22. public function save(\Magento\Customer\Api\Data\AddressInterface $address);
  23. /**
  24. * Retrieve customer address.
  25. *
  26. * @param int $addressId
  27. * @return \Magento\Customer\Api\Data\AddressInterface
  28. * @throws \Magento\Framework\Exception\LocalizedException
  29. */
  30. public function getById($addressId);
  31. /**
  32. * Retrieve customers addresses matching the specified criteria.
  33. *
  34. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  35. * @return \Magento\Customer\Api\Data\AddressSearchResultsInterface
  36. * @throws \Magento\Framework\Exception\LocalizedException
  37. */
  38. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  39. /**
  40. * Delete customer address.
  41. *
  42. * @param \Magento\Customer\Api\Data\AddressInterface $address
  43. * @return bool true on success
  44. * @throws \Magento\Framework\Exception\LocalizedException
  45. */
  46. public function delete(\Magento\Customer\Api\Data\AddressInterface $address);
  47. /**
  48. * Delete customer address by ID.
  49. *
  50. * @param int $addressId
  51. * @return bool true on success
  52. * @throws \Magento\Framework\Exception\NoSuchEntityException
  53. * @throws \Magento\Framework\Exception\LocalizedException
  54. */
  55. public function deleteById($addressId);
  56. }