QuoteRepositoryInterface.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * This file is part of the Klarna KP module
  4. *
  5. * (c) Klarna Bank AB (publ)
  6. *
  7. * For the full copyright and license information, please view the NOTICE
  8. * and LICENSE files that were distributed with this source code.
  9. */
  10. namespace Klarna\Kp\Api;
  11. use Magento\Quote\Api\Data\CartInterface as MageQuoteInterface;
  12. /**
  13. * Interface QuoteRepositoryInterface
  14. *
  15. * @package Klarna\Kp\Api
  16. */
  17. interface QuoteRepositoryInterface
  18. {
  19. /**
  20. * @param QuoteInterface $page
  21. * @return QuoteInterface
  22. */
  23. public function save(QuoteInterface $page);
  24. /**
  25. * @param int $id
  26. * @param bool $forceReload
  27. * @return QuoteInterface
  28. */
  29. public function getById($id, $forceReload = false);
  30. /**
  31. * @param MageQuoteInterface $mageQuote
  32. * @return QuoteInterface
  33. * @throws \Magento\Framework\Exception\NoSuchEntityException
  34. */
  35. public function getActiveByQuote(MageQuoteInterface $mageQuote);
  36. /**
  37. * @param QuoteInterface $page
  38. * @return void
  39. */
  40. public function delete(QuoteInterface $page);
  41. /**
  42. * @param int $id
  43. * @return void
  44. */
  45. public function deleteById($id);
  46. /**
  47. * Mark quote as inactive and cancel it with API
  48. *
  49. * @param QuoteInterface $quote
  50. */
  51. public function markInactive(QuoteInterface $quote);
  52. /**
  53. * Load quote by session_id
  54. *
  55. * @param string $sessionId
  56. * @param bool $forceReload
  57. * @return QuoteInterface
  58. * @throws \Magento\Framework\Exception\NoSuchEntityException
  59. */
  60. public function getBySessionId($sessionId, $forceReload = false);
  61. }