Example #1
0
 /**
  * Import 'attachmentsPrivate' value
  *
  * @param \XLite\Model\Product $model  Product
  * @param array                $value  Value
  * @param array                $column Column info
  *
  * @return void
  */
 protected function importAttachmentsPrivateColumn(\XLite\Model\Product $model, array $value, array $column)
 {
     if ($value) {
         foreach ($value as $index => $val) {
             $attachment = $model->getAttachments()->get($index);
             if ($attachment) {
                 $attachment->setPrivate($this->normalizeValueAsBoolean($val));
             }
         }
     }
 }
Example #2
0
 /**
  * Import 'attachmentsDescription' value
  *
  * @param \XLite\Model\Product $model  Product
  * @param array                $value  Value
  * @param array                $column Column info
  *
  * @return void
  */
 protected function importAttachmentsDescriptionColumn(\XLite\Model\Product $model, array $value, array $column)
 {
     if ($value) {
         foreach ($value as $index => $val) {
             $attachment = $model->getAttachments()->get($index);
             if ($attachment) {
                 $this->updateModelTranslations($attachment, $val, 'description');
             }
         }
     }
 }