OrderManagementInterface.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Api;
  7. /**
  8. * Order management interface.
  9. *
  10. * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product
  11. * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as
  12. * a purchase order, is emailed to the customer.
  13. * @api
  14. * @since 100.0.2
  15. */
  16. interface OrderManagementInterface
  17. {
  18. /**
  19. * Cancels a specified order.
  20. *
  21. * @param int $id The order ID.
  22. * @return bool
  23. */
  24. public function cancel($id);
  25. /**
  26. * Lists comments for a specified order.
  27. *
  28. * @param int $id The order ID.
  29. * @return \Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface Order status history
  30. * search results interface.
  31. */
  32. public function getCommentsList($id);
  33. /**
  34. * Adds a comment to a specified order.
  35. *
  36. * @param int $id The order ID.
  37. * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $statusHistory Status history comment.
  38. * @return bool
  39. */
  40. public function addComment($id, \Magento\Sales\Api\Data\OrderStatusHistoryInterface $statusHistory);
  41. /**
  42. * Emails a user a specified order.
  43. *
  44. * @param int $id The order ID.
  45. * @return bool
  46. */
  47. public function notify($id);
  48. /**
  49. * Gets the status for a specified order.
  50. *
  51. * @param int $id The order ID.
  52. * @return string Order status.
  53. */
  54. public function getStatus($id);
  55. /**
  56. * Holds a specified order.
  57. *
  58. * @param int $id The order ID.
  59. * @return bool
  60. */
  61. public function hold($id);
  62. /**
  63. * Releases a specified order from hold status.
  64. *
  65. * @param int $id The order ID.
  66. * @return bool
  67. */
  68. public function unHold($id);
  69. /**
  70. * @param \Magento\Sales\Api\Data\OrderInterface $order
  71. * @return \Magento\Sales\Api\Data\OrderInterface
  72. */
  73. public function place(\Magento\Sales\Api\Data\OrderInterface $order);
  74. }