|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProductFamilySolver |
|
|
class ProductFamilySolver |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
protected ProductSolver $productSolver; |
|
|
protected ProductSolver $productSolver; |
|
|
protected ProductFamilySectionPropertySolver $productFamilySectionPropertySolver; |
|
|
protected ProductFamilySectionPropertySolver $productFamilySectionPropertySolver; |
|
|
protected ProductCategorySolver $productCategorySolver; |
|
|
protected ProductCategorySolver $productCategorySolver; |
|
|
|
|
|
|
|
|
$this->productCategorySolver = $productCategorySolver; |
|
|
$this->productCategorySolver = $productCategorySolver; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static function getBehaviorCountStockChoices(): array |
|
|
public static function getBehaviorCountStockChoices(): array |
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
|
|
|
|
|
|
return $productsOnlineArray; |
|
|
return $productsOnlineArray; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getReductionCatalogInherited(ProductFamilyInterface $productFamily): ?ReductionCatalogInterface |
|
|
public function getReductionCatalogInherited(ProductFamilyInterface $productFamily): ?ReductionCatalogInterface |
|
|
{ |
|
|
{ |
|
|
return $productFamily->getReductionCatalog(); |
|
|
return $productFamily->getReductionCatalog(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily, SectionInterface $section) |
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily, SectionInterface $section) |
|
|
{ |
|
|
{ |
|
|
$productCategories = $productFamily->getProductCategories(); |
|
|
$productCategories = $productFamily->getProductCategories(); |
|
|
|
|
|
|
|
|
if (count($productCategories) > 0) { |
|
|
if (count($productCategories) > 0) { |
|
|
|
|
|
|
|
|
foreach ($productCategories as $productCategory) { |
|
|
foreach ($productCategories as $productCategory) { |
|
|
if($productCategory->getSection() === $section && $productCategory->getParent()!==null){ |
|
|
|
|
|
|
|
|
if($productCategory->getSection()->getId() == $section->getId() |
|
|
|
|
|
&& $productCategory->getParent() !== null) { |
|
|
|
|
|
|
|
|
return $productCategory->getParent(); |
|
|
return $productCategory->getParent(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return false; |
|
|
return false; |