|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| addSelection (\Magento\Catalog\Model\Product $selection) | |
| isSaleable () | |
| getDefaultSelection () | |
| isMultiSelection () | |
| getSearchableData ($productId, $storeId) | |
| getSelectionById ($selectionId) | |
| getOptionId () | |
| getTitle () | |
| getRequired () | |
| getType () | |
| getPosition () | |
| getSku () | |
| getProductLinks () | |
| setOptionId ($optionId) | |
| setTitle ($title) | |
| setRequired ($required) | |
| setType ($type) | |
| setPosition ($position) | |
| setSku ($sku) | |
| setProductLinks (array $productLinks=null) | |
| getExtensionAttributes () | |
| setExtensionAttributes (\Magento\Bundle\Api\Data\OptionExtensionInterface $extensionAttributes) | |
Public Member Functions inherited from AbstractExtensibleModel | |
| __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[]) | |
| getCustomAttributes () | |
| getCustomAttribute ($attributeCode) | |
| setCustomAttributes (array $attributes) | |
| setCustomAttribute ($attributeCode, $attributeValue) | |
| setData ($key, $value=null) | |
| unsetData ($key=null) | |
| getData ($key='', $index=null) | |
| setId ($value) | |
| __sleep () | |
| __wakeup () | |
Public Member Functions inherited from AbstractModel | |
| __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[]) | |
| __sleep () | |
| __wakeup () | |
| setIdFieldName ($name) | |
| getIdFieldName () | |
| getId () | |
| setId ($value) | |
| isDeleted ($isDeleted=null) | |
| hasDataChanges () | |
| setData ($key, $value=null) | |
| unsetData ($key=null) | |
| setDataChanges ($value) | |
| getOrigData ($key=null) | |
| setOrigData ($key=null, $data=null) | |
| dataHasChangedFor ($field) | |
| getResourceName () | |
| getResourceCollection () | |
| getCollection () | |
| load ($modelId, $field=null) | |
| beforeLoad ($identifier, $field=null) | |
| afterLoad () | |
| isSaveAllowed () | |
| setHasDataChanges ($flag) | |
| save () | |
| afterCommitCallback () | |
| isObjectNew ($flag=null) | |
| beforeSave () | |
| validateBeforeSave () | |
| getCacheTags () | |
| cleanModelCache () | |
| afterSave () | |
| delete () | |
| beforeDelete () | |
| afterDelete () | |
| afterDeleteCommit () | |
| getResource () | |
| getEntityId () | |
| setEntityId ($entityId) | |
| clearInstance () | |
| getStoredData () | |
| getEventPrefix () | |
Public Member Functions inherited from DataObject | |
| __construct (array $data=[]) | |
| addData (array $arr) | |
| setData ($key, $value=null) | |
| unsetData ($key=null) | |
| getData ($key='', $index=null) | |
| getDataByPath ($path) | |
| getDataByKey ($key) | |
| setDataUsingMethod ($key, $args=[]) | |
| getDataUsingMethod ($key, $args=null) | |
| hasData ($key='') | |
| toArray (array $keys=[]) | |
| convertToArray (array $keys=[]) | |
| toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
| convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
| toJson (array $keys=[]) | |
| convertToJson (array $keys=[]) | |
| toString ($format='') | |
| __call ($method, $args) | |
| isEmpty () | |
| serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
| debug ($data=null, &$objects=[]) | |
| offsetSet ($offset, $value) | |
| offsetExists ($offset) | |
| offsetUnset ($offset) | |
| offsetGet ($offset) | |
Data Fields | |
| const | KEY_OPTION_ID = 'option_id' |
| const | KEY_TITLE = 'title' |
| const | KEY_REQUIRED = 'required' |
| const | KEY_TYPE = 'type' |
| const | KEY_POSITION = 'position' |
| const | KEY_SKU = 'sku' |
| const | KEY_PRODUCT_LINKS = 'product_links' |
Data Fields inherited from CustomAttributesDataInterface | |
| const | CUSTOM_ATTRIBUTES = 'custom_attributes' |
Data Fields inherited from ExtensibleDataInterface | |
| const | EXTENSION_ATTRIBUTES_KEY = 'extension_attributes' |
Protected Member Functions | |
| _construct () | |
Protected Member Functions inherited from AbstractExtensibleModel | |
| filterCustomAttributes ($data) | |
| initializeCustomAttributes () | |
| convertCustomAttributeValues (array &$customAttributes) | |
| getCustomAttributesCodes () | |
| _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes) | |
| _getExtensionAttributes () | |
Protected Member Functions inherited from AbstractModel | |
| _construct () | |
| _init ($resourceModel) | |
| _setResourceModel ($resourceName, $collectionName=null) | |
| _getResource () | |
| _getEventData () | |
| _beforeLoad ($modelId, $field=null) | |
| _afterLoad () | |
| _hasModelChanged () | |
| _getValidatorBeforeSave () | |
| _createValidatorBeforeSave () | |
| _getValidationRulesBeforeSave () | |
| _clearReferences () | |
| _clearData () | |
Protected Member Functions inherited from DataObject | |
| _getData ($key) | |
| _underscore ($name) | |
Protected Attributes | |
| $defaultSelection = null | |
Protected Attributes inherited from AbstractExtensibleModel | |
| $extensionAttributesFactory | |
| $extensionAttributes | |
| $customAttributeFactory | |
| $customAttributesCodes = null | |
| $customAttributesChanged = false | |
Protected Attributes inherited from AbstractModel | |
| $_eventPrefix = 'core_abstract' | |
| $_eventObject = 'object' | |
| $_idFieldName = 'id' | |
| $_hasDataChanges = false | |
| $_origData | |
| $_isDeleted = false | |
| $_resource | |
| $_resourceCollection | |
| $_resourceName | |
| $_collectionName | |
| $_cacheTag = false | |
| $_dataSaveAllowed = true | |
| $_isObjectNew = null | |
| $_validatorBeforeSave = null | |
| $_eventManager | |
| $_cacheManager | |
| $_registry | |
| $_logger | |
| $_appState | |
| $_actionValidator | |
| $storedData = [] | |
Protected Attributes inherited from DataObject | |
| $_data = [] | |
Additional Inherited Members | |
Static Protected Attributes inherited from DataObject | |
| static | $_underscoreCache = [] |
@api @method int getParentId() @method null|\Magento\Catalog\Model\Product[] getSelections() @method Option setParentId(int $value)
Definition at line 17 of file Option.php.
|
protected |
| addSelection | ( | \Magento\Catalog\Model\Product | $selection | ) |
Add selection to option
| \Magento\Catalog\Model\Product | $selection |
Definition at line 52 of file Option.php.
| getDefaultSelection | ( | ) |
Retrieve default Selection object
Definition at line 87 of file Option.php.
| getExtensionAttributes | ( | ) |
{Retrieve existing extension attributes object or create a new one.
Implements OptionInterface.
Definition at line 280 of file Option.php.
| getOptionId | ( | ) |
{Get option id
Implements OptionInterface.
Definition at line 145 of file Option.php.
| getPosition | ( | ) |
{Get option position
Implements OptionInterface.
Definition at line 177 of file Option.php.
| getProductLinks | ( | ) |
{Get product links
Implements OptionInterface.
Definition at line 193 of file Option.php.
| getRequired | ( | ) |
{Get is required option
Implements OptionInterface.
Definition at line 161 of file Option.php.
| getSearchableData | ( | $productId, | |
| $storeId | |||
| ) |
Retrieve options searchable data
| int | $productId | |
| int | $storeId |
Definition at line 117 of file Option.php.
| getSelectionById | ( | $selectionId | ) |
Return selection by it's id
| int | $selectionId |
Definition at line 128 of file Option.php.
| getSku | ( | ) |
{Get product sku
Implements OptionInterface.
Definition at line 185 of file Option.php.
| getTitle | ( | ) |
{Get option title
Implements OptionInterface.
Definition at line 153 of file Option.php.
| getType | ( | ) |
{Get input type
Implements OptionInterface.
Definition at line 169 of file Option.php.
| isMultiSelection | ( | ) |
| isSaleable | ( | ) |
| setExtensionAttributes | ( | \Magento\Bundle\Api\Data\OptionExtensionInterface | $extensionAttributes | ) |
{Set an extension attributes object.
| \Magento\Bundle\Api\Data\OptionExtensionInterface | $extensionAttributes |
| \Magento\Bundle\Api\Data\OptionExtensionInterface | $extensionAttributes |
Implements OptionInterface.
Definition at line 291 of file Option.php.
| setOptionId | ( | $optionId | ) |
Set option id
| int | $optionId |
Implements OptionInterface.
Definition at line 204 of file Option.php.
| setPosition | ( | $position | ) |
Set option position
| int | $position |
Implements OptionInterface.
Definition at line 248 of file Option.php.
| setProductLinks | ( | array | $productLinks = null | ) |
Set product links
Implements OptionInterface.
Definition at line 270 of file Option.php.
| setRequired | ( | $required | ) |
Set whether option is required
| bool | $required |
Implements OptionInterface.
Definition at line 226 of file Option.php.
| setSku | ( | $sku | ) |
Set product sku
| string | $sku |
Implements OptionInterface.
Definition at line 259 of file Option.php.
| setTitle | ( | $title | ) |
Set option title
| string | $title |
Implements OptionInterface.
Definition at line 215 of file Option.php.
| setType | ( | $type | ) |
Set input type
| string | $type |
Implements OptionInterface.
Definition at line 237 of file Option.php.
|
protected |
#- #-
Definition at line 33 of file Option.php.
| const KEY_OPTION_ID = 'option_id' |
#+ Constants
Definition at line 23 of file Option.php.
| const KEY_POSITION = 'position' |
Definition at line 27 of file Option.php.
| const KEY_PRODUCT_LINKS = 'product_links' |
Definition at line 29 of file Option.php.
| const KEY_REQUIRED = 'required' |
Definition at line 25 of file Option.php.
| const KEY_SKU = 'sku' |
Definition at line 28 of file Option.php.
| const KEY_TITLE = 'title' |
Definition at line 24 of file Option.php.
| const KEY_TYPE = 'type' |
Definition at line 26 of file Option.php.