ShippingInterface.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Api\Data;
  7. /**
  8. * Interface ShippingInterface
  9. * @api
  10. * @since 100.0.4
  11. */
  12. interface ShippingInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. /**#@+
  15. * Shipping object data keys
  16. */
  17. const KEY_ADDRESS = 'address';
  18. const KEY_METHOD = 'method';
  19. const KEY_TOTAL = 'total';
  20. /**#@-*/
  21. /**
  22. * Gets shipping address
  23. *
  24. * @return \Magento\Sales\Api\Data\OrderAddressInterface|null
  25. * @since 100.0.4
  26. */
  27. public function getAddress();
  28. /**
  29. * Gets shipping method
  30. *
  31. * @return string|null
  32. * @since 100.0.4
  33. */
  34. public function getMethod();
  35. /**
  36. * Gets object with shipping totals
  37. *
  38. * @return \Magento\Sales\Api\Data\TotalInterface|null
  39. * @since 100.0.4
  40. */
  41. public function getTotal();
  42. /**
  43. * Sets address to shipping
  44. *
  45. * @param \Magento\Sales\Api\Data\OrderAddressInterface $address
  46. * @return $this
  47. * @since 100.0.4
  48. */
  49. public function setAddress(\Magento\Sales\Api\Data\OrderAddressInterface $address);
  50. /**
  51. * Sets method to shipping
  52. *
  53. * @param string $method
  54. * @return $this
  55. * @since 100.0.4
  56. */
  57. public function setMethod($method);
  58. /**
  59. * Sets total object to shipping
  60. *
  61. * @param \Magento\Sales\Api\Data\TotalInterface $total
  62. * @return $this
  63. * @since 100.0.4
  64. */
  65. public function setTotal(\Magento\Sales\Api\Data\TotalInterface $total);
  66. /**
  67. * Retrieve existing extension attributes object or create a new one.
  68. *
  69. * @return \Magento\Sales\Api\Data\ShippingExtensionInterface|null
  70. * @since 100.0.4
  71. */
  72. public function getExtensionAttributes();
  73. /**
  74. * Set an extension attributes object.
  75. *
  76. * @param \Magento\Sales\Api\Data\ShippingExtensionInterface $extensionAttributes
  77. * @return $this
  78. * @since 100.0.4
  79. */
  80. public function setExtensionAttributes(
  81. \Magento\Sales\Api\Data\ShippingExtensionInterface $extensionAttributes
  82. );
  83. }