Details.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Tax\Model\Sales\Order;
  8. /**
  9. * @codeCoverageIgnore
  10. */
  11. class Details extends \Magento\Framework\Model\AbstractExtensibleModel implements
  12. \Magento\Tax\Api\Data\OrderTaxDetailsInterface
  13. {
  14. /**#@+
  15. * Constants defined for keys of array, makes typos less likely
  16. */
  17. const KEY_APPLIED_TAXES = 'applied_taxes';
  18. const KEY_ITEMS = 'items';
  19. /**#@-*/
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function getAppliedTaxes()
  24. {
  25. return $this->getData(self::KEY_APPLIED_TAXES);
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getItems()
  31. {
  32. return $this->getData(self::KEY_ITEMS);
  33. }
  34. /**
  35. * Set applied taxes at order level
  36. *
  37. * @param \Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface[] $appliedTaxes
  38. * @return $this
  39. */
  40. public function setAppliedTaxes(array $appliedTaxes = null)
  41. {
  42. return $this->setData(self::KEY_APPLIED_TAXES, $appliedTaxes);
  43. }
  44. /**
  45. * Set order item tax details
  46. *
  47. * @param \Magento\Tax\Api\Data\OrderTaxDetailsItemInterface[] $items
  48. * @return $this
  49. */
  50. public function setItems(array $items = null)
  51. {
  52. return $this->setData(self::KEY_ITEMS, $items);
  53. }
  54. /**
  55. * {@inheritdoc}
  56. *
  57. * @return \Magento\Tax\Api\Data\OrderTaxDetailsExtensionInterface|null
  58. */
  59. public function getExtensionAttributes()
  60. {
  61. return $this->_getExtensionAttributes();
  62. }
  63. /**
  64. * {@inheritdoc}
  65. *
  66. * @param \Magento\Tax\Api\Data\OrderTaxDetailsExtensionInterface $extensionAttributes
  67. * @return $this
  68. */
  69. public function setExtensionAttributes(\Magento\Tax\Api\Data\OrderTaxDetailsExtensionInterface $extensionAttributes)
  70. {
  71. return $this->_setExtensionAttributes($extensionAttributes);
  72. }
  73. }