@@ 500-509 (lines=10) @@ | ||
497 | $Categories = $form->get('Category')->getData(); |
|
498 | $categoriesIdList = []; |
|
499 | foreach ($Categories as $Category) { |
|
500 | foreach ($Category->getPath() as $ParentCategory) { |
|
501 | if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
502 | $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count); |
|
503 | $this->entityManager->persist($ProductCategory); |
|
504 | $count++; |
|
505 | /* @var $Product \Eccube\Entity\Product */ |
|
506 | $Product->addProductCategory($ProductCategory); |
|
507 | $categoriesIdList[$ParentCategory->getId()] = true; |
|
508 | } |
|
509 | } |
|
510 | if (!isset($categoriesIdList[$Category->getId()])) { |
|
511 | $ProductCategory = $this->createProductCategory($Product, $Category, $count); |
|
512 | $this->entityManager->persist($ProductCategory); |
@@ 996-1004 (lines=9) @@ | ||
993 | ]); |
|
994 | $this->addErrors($message); |
|
995 | } else { |
|
996 | foreach ($Category->getPath() as $ParentCategory) { |
|
997 | if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
998 | $ProductCategory = $this->makeProductCategory($Product, $ParentCategory, $sortNo); |
|
999 | $this->entityManager->persist($ProductCategory); |
|
1000 | $sortNo++; |
|
1001 | ||
1002 | $Product->addProductCategory($ProductCategory); |
|
1003 | $categoriesIdList[$ParentCategory->getId()] = true; |
|
1004 | } |
|
1005 | } |
|
1006 | if (!isset($categoriesIdList[$Category->getId()])) { |
|
1007 | $ProductCategory = $this->makeProductCategory($Product, $Category, $sortNo); |