Key.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Model\TaxClass;
  7. use Magento\Framework\Model\AbstractExtensibleModel;
  8. use Magento\Tax\Api\Data\TaxClassKeyInterface;
  9. /**
  10. * @codeCoverageIgnore
  11. */
  12. class Key extends AbstractExtensibleModel implements TaxClassKeyInterface
  13. {
  14. /**#@+
  15. * Constants defined for keys of array, makes typos less likely
  16. */
  17. const KEY_TYPE = 'type';
  18. const KEY_VALUE = 'value';
  19. /**#@-*/
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function getType()
  24. {
  25. return $this->getData(self::KEY_TYPE);
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getValue()
  31. {
  32. return $this->getData(self::KEY_VALUE);
  33. }
  34. /**
  35. * Set type of tax class key
  36. *
  37. * @param string $type
  38. * @return $this
  39. */
  40. public function setType($type)
  41. {
  42. return $this->setData(self::KEY_TYPE, $type);
  43. }
  44. /**
  45. * Set value of tax class key
  46. *
  47. * @param string $value
  48. * @return $this
  49. */
  50. public function setValue($value)
  51. {
  52. return $this->setData(self::KEY_VALUE, $value);
  53. }
  54. /**
  55. * {@inheritdoc}
  56. *
  57. * @return \Magento\Tax\Api\Data\TaxClassKeyExtensionInterface|null
  58. */
  59. public function getExtensionAttributes()
  60. {
  61. return $this->_getExtensionAttributes();
  62. }
  63. /**
  64. * {@inheritdoc}
  65. *
  66. * @param \Magento\Tax\Api\Data\TaxClassKeyExtensionInterface $extensionAttributes
  67. * @return $this
  68. */
  69. public function setExtensionAttributes(\Magento\Tax\Api\Data\TaxClassKeyExtensionInterface $extensionAttributes)
  70. {
  71. return $this->_setExtensionAttributes($extensionAttributes);
  72. }
  73. }