AttributeValue.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Api;
  7. /**
  8. * Custom Attribute Data object
  9. */
  10. class AttributeValue extends AbstractSimpleObject implements AttributeInterface
  11. {
  12. /**
  13. * Get attribute code
  14. *
  15. * @return string
  16. */
  17. public function getAttributeCode()
  18. {
  19. return $this->_get(self::ATTRIBUTE_CODE);
  20. }
  21. /**
  22. * Get attribute value
  23. *
  24. * @return mixed
  25. */
  26. public function getValue()
  27. {
  28. return $this->_get(self::VALUE);
  29. }
  30. /**
  31. * Set attribute code
  32. *
  33. * @param string $attributeCode
  34. * @return $this
  35. */
  36. public function setAttributeCode($attributeCode)
  37. {
  38. $this->_data[self::ATTRIBUTE_CODE] = $attributeCode;
  39. return $this;
  40. }
  41. /**
  42. * Set attribute value
  43. *
  44. * @param mixed $value
  45. * @return $this
  46. */
  47. public function setValue($value)
  48. {
  49. $this->_data[self::VALUE] = $value;
  50. return $this;
  51. }
  52. }