OrderRepositoryInterface.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * This file is part of the Klarna Core 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\Core\Api;
  11. use Magento\Sales\Api\Data\OrderInterface as MageOrder;
  12. /**
  13. * Interface OrderRepositoryInterface
  14. *
  15. * @package Klarna\Core\Api
  16. */
  17. interface OrderRepositoryInterface
  18. {
  19. /**
  20. * Save an order
  21. *
  22. * @param OrderInterface $order
  23. * @return OrderInterface
  24. * @throws \Magento\Framework\Exception\CouldNotSaveException
  25. */
  26. public function save(OrderInterface $order);
  27. /**
  28. * Get order by ID
  29. *
  30. * @param int $id
  31. * @return OrderInterface
  32. * @throws \Magento\Framework\Exception\CouldNotSaveException
  33. */
  34. public function getById($id);
  35. /**
  36. * Load by Klarna order id
  37. *
  38. * @param string $klarnaOrderId
  39. * @return OrderInterface
  40. * @throws \Magento\Framework\Exception\NoSuchEntityException
  41. */
  42. public function getByKlarnaOrderId($klarnaOrderId);
  43. /**
  44. * Load by session id
  45. *
  46. * @param string $sessionId
  47. * @return OrderInterface
  48. * @throws \Magento\Framework\Exception\NoSuchEntityException
  49. */
  50. public function getBySessionId($sessionId);
  51. /**
  52. * Load by reservation id
  53. *
  54. * @param string $reservationId
  55. * @return OrderInterface
  56. * @throws \Magento\Framework\Exception\NoSuchEntityException
  57. */
  58. public function getByReservationId($reservationId);
  59. /**
  60. * Load by an order
  61. *
  62. * @param MageOrder $mageOrder
  63. * @return OrderInterface
  64. * @throws \Magento\Framework\Exception\NoSuchEntityException
  65. */
  66. public function getByOrder(MageOrder $mageOrder);
  67. }