Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function getSource()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getSource');
     if (!$pluginInfo) {
         return parent::getSource();
     } else {
         return $this->___callPlugins('getSource', func_get_args(), $pluginInfo);
     }
 }
Esempio n. 2
0
 /**
  * Creates array which link new option ids
  *
  * @param Attribute $attribute
  * @return Attribute
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 protected function processSwatchOptions(Attribute $attribute)
 {
     $optionsArray = $attribute->getData('option');
     if (!empty($optionsArray) && is_array($optionsArray)) {
         $optionsArray = $this->prepareOptionIds($optionsArray);
         $attributeSavedOptions = $attribute->getSource()->getAllOptions();
         $this->prepareOptionLinks($optionsArray, $attributeSavedOptions);
     }
     return $attribute;
 }