CartRepositoryInterface.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Api;
  7. /**
  8. * Interface CartRepositoryInterface
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface CartRepositoryInterface
  13. {
  14. /**
  15. * Enables an administrative user to return information for a specified cart.
  16. *
  17. * @param int $cartId
  18. * @return \Magento\Quote\Api\Data\CartInterface
  19. * @throws \Magento\Framework\Exception\NoSuchEntityException
  20. */
  21. public function get($cartId);
  22. /**
  23. * Enables administrative users to list carts that match specified search criteria.
  24. *
  25. * This call returns an array of objects, but detailed information about each object’s attributes might not be
  26. * included. See https://devdocs.magento.com/codelinks/attributes.html#CartRepositoryInterface to determine
  27. * which call to use to get detailed information about all attributes for an object.
  28. *
  29. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  30. * @return \Magento\Quote\Api\Data\CartSearchResultsInterface
  31. */
  32. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  33. /**
  34. * Get quote by customer Id
  35. *
  36. * @param int $customerId
  37. * @param int[] $sharedStoreIds
  38. * @return \Magento\Quote\Api\Data\CartInterface
  39. * @throws \Magento\Framework\Exception\NoSuchEntityException
  40. */
  41. public function getForCustomer($customerId, array $sharedStoreIds = []);
  42. /**
  43. * Get active quote by id
  44. *
  45. * @param int $cartId
  46. * @param int[] $sharedStoreIds
  47. * @return \Magento\Quote\Api\Data\CartInterface
  48. * @throws \Magento\Framework\Exception\NoSuchEntityException
  49. */
  50. public function getActive($cartId, array $sharedStoreIds = []);
  51. /**
  52. * Get active quote by customer Id
  53. *
  54. * @param int $customerId
  55. * @param int[] $sharedStoreIds
  56. * @return \Magento\Quote\Api\Data\CartInterface
  57. * @throws \Magento\Framework\Exception\NoSuchEntityException
  58. */
  59. public function getActiveForCustomer($customerId, array $sharedStoreIds = []);
  60. /**
  61. * Save quote
  62. *
  63. * @param \Magento\Quote\Api\Data\CartInterface $quote
  64. * @return void
  65. */
  66. public function save(\Magento\Quote\Api\Data\CartInterface $quote);
  67. /**
  68. * Delete quote
  69. *
  70. * @param \Magento\Quote\Api\Data\CartInterface $quote
  71. * @return void
  72. */
  73. public function delete(\Magento\Quote\Api\Data\CartInterface $quote);
  74. }