AttributeMetadata.php 775 B

123456789101112131415161718192021222324252627282930313233343536
  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. * Base data object for custom attribute metadata
  9. */
  10. class AttributeMetadata extends AbstractSimpleObject implements MetadataObjectInterface
  11. {
  12. const ATTRIBUTE_CODE = 'attribute_code';
  13. /**
  14. * Retrieve code of the attribute.
  15. *
  16. * @return string|null
  17. */
  18. public function getAttributeCode()
  19. {
  20. return $this->_get(self::ATTRIBUTE_CODE);
  21. }
  22. /**
  23. * Set code of the attribute.
  24. *
  25. * @param string $attributeCode
  26. * @return $this
  27. */
  28. public function setAttributeCode($attributeCode)
  29. {
  30. return $this->setData(self::ATTRIBUTE_CODE, $attributeCode);
  31. }
  32. }