productFamilySectionPropertySolver = $productFamilySectionPropertySolver; } public function isOnline(ProductCategoryInterface $productCategory) { if ($productCategory->getParent()) { if ($productCategory->getStatus() && $productCategory->getParent()->getStatus()) { return true; } } elseif ($productCategory->getStatus()) { return true; } return false; } public function hasOnlineProductFamily(ProductCategoryInterface $productCategory){ if($productCategory->getProductFamilies()) { foreach ($productCategory->getProductFamilies() as $productFamily) { $productFamilySectionProperty = $this->productFamilySectionPropertySolver->getProductFamilySectionProperty($productFamily, $productCategory->getSection()); //vérifie que le produit est en ligne et qu'il est actif sur cette section if ($productFamily->getStatus() == 1 && $productFamilySectionProperty && $productFamilySectionProperty->getStatus() == 1) { return true; } } } foreach($productCategory->getChildrens() as $productCategoryChildren){ if($this->hasOnlineProductFamily($productCategoryChildren) && $productCategoryChildren->getStatus()==1){ return true; } } return false; } }