123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Eav\Model\Entity\Attribute;
- use Magento\Eav\Api\Data\AttributeOptionInterface;
- use Magento\Framework\Model\AbstractModel;
- /**
- * Entity attribute option model
- *
- * @method int getAttributeId()
- * @method \Magento\Eav\Model\Entity\Attribute\Option setAttributeId(int $value)
- *
- * @api
- * @codeCoverageIgnore
- * @since 100.0.2
- */
- class Option extends AbstractModel implements AttributeOptionInterface
- {
- /**
- * Resource initialization
- *
- * @return void
- */
- public function _construct()
- {
- $this->_init(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option::class);
- }
- /**
- * {@inheritdoc}
- */
- public function getLabel()
- {
- return $this->getData(AttributeOptionInterface::LABEL);
- }
- /**
- * {@inheritdoc}
- */
- public function getValue()
- {
- return $this->getData(AttributeOptionInterface::VALUE);
- }
- /**
- * {@inheritdoc}
- */
- public function getSortOrder()
- {
- return $this->getData(AttributeOptionInterface::SORT_ORDER);
- }
- /**
- * {@inheritdoc}
- */
- public function getIsDefault()
- {
- return $this->getData(AttributeOptionInterface::IS_DEFAULT);
- }
- /**
- * {@inheritdoc}
- */
- public function getStoreLabels()
- {
- return $this->getData(AttributeOptionInterface::STORE_LABELS);
- }
- /**
- * Set option label
- *
- * @param string $label
- * @return $this
- */
- public function setLabel($label)
- {
- return $this->setData(AttributeOptionInterface::LABEL, $label);
- }
- /**
- * Set option value
- *
- * @param string $value
- * @return string
- */
- public function setValue($value)
- {
- return $this->setData(AttributeOptionInterface::VALUE, $value);
- }
- /**
- * Set option order
- *
- * @param int $sortOrder
- * @return $this
- */
- public function setSortOrder($sortOrder)
- {
- return $this->setData(AttributeOptionInterface::SORT_ORDER, $sortOrder);
- }
- /**
- * set is default
- *
- * @param bool $isDefault
- * @return $this
- */
- public function setIsDefault($isDefault)
- {
- return $this->setData(AttributeOptionInterface::IS_DEFAULT, $isDefault);
- }
- /**
- * Set option label for store scopes
- *
- * @param \Magento\Eav\Api\Data\AttributeOptionLabelInterface[] $storeLabels
- * @return $this
- */
- public function setStoreLabels(array $storeLabels = null)
- {
- return $this->setData(AttributeOptionInterface::STORE_LABELS, $storeLabels);
- }
- }
|