Ejemplo n.º 1
0
 /**
  * Retrieve data for update attribute
  *
  * @param  \Magento\Catalog\Model\Product $object
  * @return array
  */
 public function getAffectedFields($object)
 {
     $data = [];
     $images = (array) $object->getData($this->getAttribute()->getName());
     $tableName = $this->resourceModel->getMainTable();
     foreach ($images['images'] as $value) {
         if (empty($value['value_id'])) {
             continue;
         }
         $data[$tableName][] = ['value_id' => $value['value_id'], 'attribute_id' => $this->getAttribute()->getAttributeId(), 'entity_id' => $object->getId()];
     }
     return $data;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getMainTable()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getMainTable');
     if (!$pluginInfo) {
         return parent::getMainTable();
     } else {
         return $this->___callPlugins('getMainTable', func_get_args(), $pluginInfo);
     }
 }