FakeAttributeMetadata.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\TestModuleExtensionAttributes\Model\Data;
  8. /**
  9. * Customer attribute metadata class.
  10. */
  11. class FakeAttributeMetadata extends \Magento\Framework\Api\AbstractSimpleObject implements
  12. \Magento\TestModuleExtensionAttributes\Api\Data\FakeAttributeMetadataInterface
  13. {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. public function getAttributeCode()
  18. {
  19. return $this->_get(self::ATTRIBUTE_CODE);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function getStoreLabel()
  25. {
  26. return $this->_get(self::STORE_LABEL);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function getFrontendLabel()
  32. {
  33. return $this->_get(self::FRONTEND_LABEL);
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function getNote()
  39. {
  40. return $this->_get(self::NOTE);
  41. }
  42. /**
  43. * Set attribute code
  44. *
  45. * @param string $attributeCode
  46. * @return $this
  47. */
  48. public function setAttributeCode($attributeCode)
  49. {
  50. return $this->setData(self::ATTRIBUTE_CODE, $attributeCode);
  51. }
  52. /**
  53. * Set label of the store.
  54. *
  55. * @param string $storeLabel
  56. * @return $this
  57. */
  58. public function setStoreLabel($storeLabel)
  59. {
  60. return $this->setData(self::STORE_LABEL, $storeLabel);
  61. }
  62. /**
  63. * Set label which supposed to be displayed on frontend.
  64. *
  65. * @param string $frontendLabel
  66. * @return $this
  67. */
  68. public function setFrontendLabel($frontendLabel)
  69. {
  70. return $this->setData(self::FRONTEND_LABEL, $frontendLabel);
  71. }
  72. /**
  73. * Set the note attribute for the element.
  74. *
  75. * @param string $note
  76. * @return $this
  77. */
  78. public function setNote($note)
  79. {
  80. return $this->setData(self::NOTE, $note);
  81. }
  82. }