Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Option.php
Go to the documentation of this file.
1 <?php
7 
10 
22 {
28  public function _construct()
29  {
30  $this->_init(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option::class);
31  }
32 
36  public function getLabel()
37  {
38  return $this->getData(AttributeOptionInterface::LABEL);
39  }
40 
44  public function getValue()
45  {
46  return $this->getData(AttributeOptionInterface::VALUE);
47  }
48 
52  public function getSortOrder()
53  {
54  return $this->getData(AttributeOptionInterface::SORT_ORDER);
55  }
56 
60  public function getIsDefault()
61  {
62  return $this->getData(AttributeOptionInterface::IS_DEFAULT);
63  }
64 
68  public function getStoreLabels()
69  {
70  return $this->getData(AttributeOptionInterface::STORE_LABELS);
71  }
72 
79  public function setLabel($label)
80  {
81  return $this->setData(AttributeOptionInterface::LABEL, $label);
82  }
83 
90  public function setValue($value)
91  {
92  return $this->setData(AttributeOptionInterface::VALUE, $value);
93  }
94 
101  public function setSortOrder($sortOrder)
102  {
103  return $this->setData(AttributeOptionInterface::SORT_ORDER, $sortOrder);
104  }
105 
112  public function setIsDefault($isDefault)
113  {
114  return $this->setData(AttributeOptionInterface::IS_DEFAULT, $isDefault);
115  }
116 
123  public function setStoreLabels(array $storeLabels = null)
124  {
125  return $this->setData(AttributeOptionInterface::STORE_LABELS, $storeLabels);
126  }
127 }
getData($key='', $index=null)
Definition: DataObject.php:119
$label
Definition: details.phtml:21
$value
Definition: gender.phtml:16
setStoreLabels(array $storeLabels=null)
Definition: Option.php:123