/**
  * {@inheritdoc}
  */
 public function bindValueToEntity($valueId, $entityId)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'bindValueToEntity');
     if (!$pluginInfo) {
         return parent::bindValueToEntity($valueId, $entityId);
     } else {
         return $this->___callPlugins('bindValueToEntity', func_get_args(), $pluginInfo);
     }
 }
Exemple #2
0
 /**
  * Processes image as new.
  *
  * @param \Magento\Catalog\Model\Product $product
  * @param array $image
  * @return array
  */
 protected function processNewImage($product, array &$image)
 {
     $data = [];
     $data['value'] = $image['file'];
     $data['attribute_id'] = $this->getAttribute()->getAttributeId();
     if (!empty($image['media_type'])) {
         $data['media_type'] = $image['media_type'];
     }
     $image['value_id'] = $this->resourceModel->insertGallery($data);
     $this->resourceModel->bindValueToEntity($image['value_id'], $product->getData($this->metadata->getLinkField()));
     return $data;
 }