Option.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * Eav attribute option
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Customer\Model\Data;
  9. /**
  10. * Class Option
  11. */
  12. class Option extends \Magento\Framework\Api\AbstractSimpleObject implements
  13. \Magento\Customer\Api\Data\OptionInterface
  14. {
  15. /**
  16. * Get option label
  17. *
  18. * @return string
  19. */
  20. public function getLabel()
  21. {
  22. return $this->_get(self::LABEL);
  23. }
  24. /**
  25. * Get option value
  26. *
  27. * @return string|null
  28. */
  29. public function getValue()
  30. {
  31. return $this->_get(self::VALUE);
  32. }
  33. /**
  34. * Get nested options
  35. *
  36. * @return \Magento\Customer\Api\Data\OptionInterface[]|null
  37. */
  38. public function getOptions()
  39. {
  40. return $this->_get(self::OPTIONS);
  41. }
  42. /**
  43. * Set option label
  44. *
  45. * @param string $label
  46. * @return $this
  47. */
  48. public function setLabel($label)
  49. {
  50. return $this->setData(self::LABEL, $label);
  51. }
  52. /**
  53. * Set option value
  54. *
  55. * @param string $value
  56. * @return $this
  57. */
  58. public function setValue($value)
  59. {
  60. return $this->setData(self::VALUE, $value);
  61. }
  62. /**
  63. * Set nested options
  64. *
  65. * @param \Magento\Customer\Api\Data\OptionInterface[] $options
  66. * @return $this
  67. */
  68. public function setOptions(array $options = null)
  69. {
  70. return $this->setData(self::OPTIONS, $options);
  71. }
  72. }