浏览代码

Ajout méthode getSection()

packProduct
Guillaume 3 年前
父节点
当前提交
1c5b2acd59
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. +11
    -0
      Solver/Product/ProductFamilySolver.php

+ 11
- 0
Solver/Product/ProductFamilySolver.php 查看文件

@@ -9,6 +9,7 @@ use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;

class ProductFamilySolver
{
@@ -419,5 +420,15 @@ class ProductFamilySolver
return false;
}

public function getSection(ProductFamilyInterface $productFamily): ?SectionInterface
{
foreach($productFamily->getProductFamilySectionProperties() as $productFamilySectionProperty) {
if($productFamilySectionProperty->getStatus()) {
return $productFamilySectionProperty->getSection();
}
}

return null;
}
}


正在加载...
取消
保存