AppliedTaxRate.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Model\TaxDetails;
  7. use Magento\Framework\Model\AbstractExtensibleModel;
  8. use Magento\Tax\Api\Data\AppliedTaxRateInterface;
  9. /**
  10. * @codeCoverageIgnore
  11. */
  12. class AppliedTaxRate extends AbstractExtensibleModel implements AppliedTaxRateInterface
  13. {
  14. /**#@+
  15. * Constants defined for keys of array, makes typos less likely
  16. */
  17. const KEY_CODE = 'code';
  18. const KEY_TITLE = 'title';
  19. const KEY_PERCENT = 'percent';
  20. /**#@-*/
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function getCode()
  25. {
  26. return $this->getData(self::KEY_CODE);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function getTitle()
  32. {
  33. return $this->getData(self::KEY_TITLE);
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function getPercent()
  39. {
  40. return $this->getData(self::KEY_PERCENT);
  41. }
  42. /**
  43. * Set code
  44. *
  45. * @param string $code
  46. * @return $this
  47. */
  48. public function setCode($code)
  49. {
  50. return $this->setData(self::KEY_CODE, $code);
  51. }
  52. /**
  53. * Set Title
  54. *
  55. * @param string $title
  56. * @return $this
  57. */
  58. public function setTitle($title)
  59. {
  60. return $this->setData(self::KEY_TITLE, $title);
  61. }
  62. /**
  63. * Set Tax Percent
  64. *
  65. * @param float $percent
  66. * @return $this
  67. */
  68. public function setPercent($percent)
  69. {
  70. return $this->setData(self::KEY_PERCENT, $percent);
  71. }
  72. /**
  73. * {@inheritdoc}
  74. *
  75. * @return \Magento\Tax\Api\Data\AppliedTaxRateExtensionInterface|null
  76. */
  77. public function getExtensionAttributes()
  78. {
  79. return $this->_getExtensionAttributes();
  80. }
  81. /**
  82. * {@inheritdoc}
  83. *
  84. * @param \Magento\Tax\Api\Data\AppliedTaxRateExtensionInterface $extensionAttributes
  85. * @return $this
  86. */
  87. public function setExtensionAttributes(\Magento\Tax\Api\Data\AppliedTaxRateExtensionInterface $extensionAttributes)
  88. {
  89. return $this->_setExtensionAttributes($extensionAttributes);
  90. }
  91. }