|
|
|
|
|
|
|
|
$productFamilySectionProperty = $event->getEntity(); |
|
|
$productFamilySectionProperty = $event->getEntity(); |
|
|
|
|
|
|
|
|
if($productFamilySectionProperty instanceof ProductFamilySectionPropertyInterface) { |
|
|
if($productFamilySectionProperty instanceof ProductFamilySectionPropertyInterface) { |
|
|
|
|
|
$section = $productFamilySectionProperty->getSection(); |
|
|
if($productFamilySectionProperty->getStatus() == 1) { |
|
|
if($productFamilySectionProperty->getStatus() == 1) { |
|
|
$productCategoryArray = $productFamilySectionProperty->getProductFamily()->getProductCategories(); |
|
|
$productCategoryArray = $productFamilySectionProperty->getProductFamily()->getProductCategories(); |
|
|
foreach($productCategoryArray as $productCategory) { |
|
|
foreach($productCategoryArray as $productCategory) { |
|
|
$productCategory->setStatus(1); |
|
|
|
|
|
$this->entityManager->update($productCategory); |
|
|
|
|
|
|
|
|
if($productCategory->getSection() == $section) { |
|
|
|
|
|
// mise à jour du statut |
|
|
|
|
|
$productCategory->setStatus(1); |
|
|
|
|
|
$this->entityManager->update($productCategory); |
|
|
|
|
|
|
|
|
|
|
|
// mise à jour du statut du parent |
|
|
|
|
|
$productCategoryParent = $productCategory->getParent(); |
|
|
|
|
|
if($productCategoryParent) { |
|
|
|
|
|
$productCategoryParent->setStatus(1); |
|
|
|
|
|
$this->entityManager->update($productCategoryParent); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |