|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily) |
|
|
|
|
|
|
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily, SectionInterface $section) |
|
|
{ |
|
|
{ |
|
|
$productCategories = $productFamily->getProductCategories(); |
|
|
$productCategories = $productFamily->getProductCategories(); |
|
|
|
|
|
|
|
|
if (count($productCategories) > 0) { |
|
|
if (count($productCategories) > 0) { |
|
|
return $productCategories[0]->getParent(); |
|
|
|
|
|
|
|
|
foreach ($productCategories as $productCategory) { |
|
|
|
|
|
if($productCategory->getSection() === $section && $productCategory->getParent()!==null){ |
|
|
|
|
|
return $productCategory->getParent(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return false; |
|
|
return false; |