54 if (!$this->
hasData(
'selections')) {
55 $this->
setData(
'selections', []);
57 $selections = $this->
getData(
'selections');
58 $selections[] = $selection;
59 $this->setSelections($selections);
70 $selections = $this->getSelections();
72 foreach ($selections as $selection) {
73 if ($selection->isSaleable()) {
89 if (!$this->defaultSelection && $this->getSelections()) {
90 foreach ($this->getSelections() as $selection) {
91 if ($selection->getIsDefault()) {
92 $this->defaultSelection = $selection;
107 return $this->
getType() ==
'checkbox' || $this->
getType() ==
'multi';
130 $foundSelection =
null;
131 foreach ($this->getSelections() as $selection) {
132 if ($selection->getSelectionId() == $selectionId) {
133 $foundSelection = $selection;
137 return $foundSelection;
147 return $this->
getData(self::KEY_OPTION_ID);
155 return $this->
getData(self::KEY_TITLE);
163 return $this->
getData(self::KEY_REQUIRED);
171 return $this->
getData(self::KEY_TYPE);
179 return $this->
getData(self::KEY_POSITION);
187 return $this->
getData(self::KEY_SKU);
195 return $this->
getData(self::KEY_PRODUCT_LINKS);
250 return $this->
setData(self::KEY_POSITION, $position);
261 return $this->
setData(self::KEY_SKU, $sku);
272 return $this->
setData(self::KEY_PRODUCT_LINKS, $productLinks);
getSearchableData($productId, $storeId)
setProductLinks(array $productLinks=null)
_getExtensionAttributes()
addSelection(\Magento\Catalog\Model\Product $selection)
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
getSelectionById($selectionId)
setExtensionAttributes(\Magento\Bundle\Api\Data\OptionExtensionInterface $extensionAttributes)
getData($key='', $index=null)
setData($key, $value=null)