| @@ 654-667 (lines=14) @@ | ||
| 651 | $this->entityManager->getConnection()->commit(); |
|
| 652 | ||
| 653 | // 画像ファイルの削除(commit後に削除させる) |
|
| 654 | foreach ($deleteImages as $images) { |
|
| 655 | /** @var ProductImage $image */ |
|
| 656 | foreach ($images as $image) { |
|
| 657 | if ($this->productImageRepository->findOneBy(['file_name' => $image->getFileName()])) { |
|
| 658 | continue; |
|
| 659 | } |
|
| 660 | try { |
|
| 661 | $fs = new Filesystem(); |
|
| 662 | $fs->remove($this->eccubeConfig['eccube_save_image_dir'].'/'.$image); |
|
| 663 | } catch (\Exception $e) { |
|
| 664 | // エラーが発生しても無視する |
|
| 665 | } |
|
| 666 | } |
|
| 667 | } |
|
| 668 | ||
| 669 | log_info('商品CSV登録完了'); |
|
| 670 | if (!$this->isSplitCsv) { |
|
| @@ 783-793 (lines=11) @@ | ||
| 780 | ||
| 781 | // 画像ファイルの削除(commit後に削除させる) |
|
| 782 | /** @var ProductImage $deleteImage */ |
|
| 783 | foreach ($deleteImages as $deleteImage) { |
|
| 784 | if ($this->productImageRepository->findOneBy(['file_name' => $deleteImage->getFileName()])) { |
|
| 785 | continue; |
|
| 786 | } |
|
| 787 | try { |
|
| 788 | $fs = new Filesystem(); |
|
| 789 | $fs->remove($this->eccubeConfig['eccube_save_image_dir'].'/'.$deleteImage); |
|
| 790 | } catch (\Exception $e) { |
|
| 791 | // エラーが発生しても無視する |
|
| 792 | } |
|
| 793 | } |
|
| 794 | ||
| 795 | log_info('商品削除完了', [$id]); |
|
| 796 | ||