CustomerPersistenceInterface.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\TestModuleDefaultHydrator\Api;
  7. /**
  8. * Customer CRUD interface
  9. */
  10. interface CustomerPersistenceInterface
  11. {
  12. /**
  13. * Create customer
  14. *
  15. * @api
  16. * @param \Magento\Customer\Api\Data\CustomerInterface $customer
  17. * @param string $passwordHash
  18. * @return \Magento\Customer\Api\Data\CustomerInterface
  19. * @throws \Magento\Framework\Exception\InputException If bad input is provided
  20. * @throws \Magento\Framework\Exception\State\InputMismatchException If the provided email is already used
  21. * @throws \Magento\Framework\Exception\LocalizedException
  22. */
  23. public function save(\Magento\Customer\Api\Data\CustomerInterface $customer);
  24. /**
  25. * Retrieve customer by email
  26. *
  27. * @api
  28. * @param string $email
  29. * @param int|null $websiteId
  30. * @return \Magento\Customer\Api\Data\CustomerInterface
  31. * @throws \Magento\Framework\Exception\NoSuchEntityException If customer with the specified email does not exist
  32. * @throws \Magento\Framework\Exception\LocalizedException
  33. */
  34. public function get($email, $websiteId = null);
  35. /**
  36. * Retrieve customer by id
  37. *
  38. * @api
  39. * @param int $id
  40. * @param int|null $websiteId
  41. * @return \Magento\Customer\Api\Data\CustomerInterface
  42. * @throws \Magento\Framework\Exception\NoSuchEntityException
  43. * @throws \Magento\Framework\Exception\LocalizedException
  44. */
  45. public function getById($id, $websiteId = null);
  46. /**
  47. * Delete customer by id
  48. *
  49. * @api
  50. * @param int $id
  51. * @return bool
  52. * @throws \Magento\Framework\Exception\NoSuchEntityException
  53. * @throws \Magento\Framework\Exception\LocalizedException
  54. */
  55. public function delete($id);
  56. }