| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function execute($entity, $arguments = []) |
||
| 45 | { |
||
| 46 | /** @var $attachments \LizardMedia\ProductAttachment\Api\Data\AttachmentInterface[] */ |
||
| 47 | $attachments = $entity->getExtensionAttributes()->getProductAttachments() ?: []; |
||
| 48 | |||
| 49 | foreach ($attachments as $attachment) { |
||
| 50 | $attachment->setId(null); |
||
| 51 | $this->attachmentRepository->save($entity->getSku(), $attachment, !$entity->getStoreId()); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $entity; |
||
| 55 | } |
||
| 56 | } |
||
| 57 |