Title.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Tax Rate Title Model
  8. *
  9. * @method int getTaxCalculationRateId()
  10. *
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. */
  13. namespace Magento\Tax\Model\Calculation\Rate;
  14. use Magento\Tax\Api\Data\TaxRateTitleInterface;
  15. class Title extends \Magento\Framework\Model\AbstractExtensibleModel implements TaxRateTitleInterface
  16. {
  17. /**#@+
  18. *
  19. * Tax rate field key.
  20. */
  21. const KEY_STORE_ID = 'store_id';
  22. const KEY_VALUE_ID = 'value';
  23. /**#@-*/
  24. /**
  25. * @return void
  26. */
  27. protected function _construct()
  28. {
  29. $this->_init(\Magento\Tax\Model\ResourceModel\Calculation\Rate\Title::class);
  30. }
  31. /**
  32. * @param int $rateId
  33. * @return $this
  34. */
  35. public function deleteByRateId($rateId)
  36. {
  37. $this->getResource()->deleteByRateId($rateId);
  38. return $this;
  39. }
  40. /**
  41. * @codeCoverageIgnoreStart
  42. * {@inheritdoc}
  43. */
  44. public function getStoreId()
  45. {
  46. return $this->getData(self::KEY_STORE_ID);
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function getValue()
  52. {
  53. return $this->getData(self::KEY_VALUE_ID);
  54. }
  55. /**
  56. * Set store id
  57. *
  58. * @param string $storeId
  59. * @return $this
  60. */
  61. public function setStoreId($storeId)
  62. {
  63. return $this->setData(self::KEY_STORE_ID, $storeId);
  64. }
  65. /**
  66. * Set title value
  67. *
  68. * @param string $value
  69. * @return string
  70. */
  71. public function setValue($value)
  72. {
  73. return $this->setData(self::KEY_VALUE_ID, $value);
  74. }
  75. // @codeCoverageIgnoreEnd
  76. /**
  77. * {@inheritdoc}
  78. *
  79. * @return \Magento\Tax\Api\Data\TaxRateTitleExtensionInterface|null
  80. */
  81. public function getExtensionAttributes()
  82. {
  83. return $this->_getExtensionAttributes();
  84. }
  85. /**
  86. * {@inheritdoc}
  87. *
  88. * @param \Magento\Tax\Api\Data\TaxRateTitleExtensionInterface $extensionAttributes
  89. * @return $this
  90. */
  91. public function setExtensionAttributes(\Magento\Tax\Api\Data\TaxRateTitleExtensionInterface $extensionAttributes)
  92. {
  93. return $this->_setExtensionAttributes($extensionAttributes);
  94. }
  95. }