/**
  * Fetch medias in local filesystem
  *
  * @param GroupInterface $variantGroup
  * @param string         $directory
  */
 protected function fetchMedia(GroupInterface $variantGroup, $directory)
 {
     if (null === ($productTemplate = $variantGroup->getProductTemplate())) {
         return;
     }
     $identifier = $variantGroup->getCode();
     $this->variantGroupUpdater->update($variantGroup, ['values' => $productTemplate->getValuesData()]);
     $this->mediaFetcher->fetchAll($productTemplate->getValues(), $directory, $identifier);
     foreach ($this->mediaFetcher->getErrors() as $error) {
         $this->stepExecution->addWarning($error['message'], [], new DataInvalidItem($error['media']));
     }
 }
Ejemplo n.º 2
0
 /**
  * Fetch medias on the local filesystem
  *
  * @param ProductInterface $product
  * @param string           $directory
  */
 protected function fetchMedia(ProductInterface $product, $directory)
 {
     $identifier = $product->getIdentifier()->getData();
     $this->mediaFetcher->fetchAll($product->getValues(), $directory, $identifier);
     foreach ($this->mediaFetcher->getErrors() as $error) {
         $this->stepExecution->addWarning($error['message'], [], new DataInvalidItem($error['media']));
     }
 }