Pārlūkot izejas kodu

Ajout méthode getSection()

packProduct
Guillaume pirms 3 gadiem
vecāks
revīzija
1c5b2acd59
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. +11
    -0
      Solver/Product/ProductFamilySolver.php

+ 11
- 0
Solver/Product/ProductFamilySolver.php Parādīt failu

@@ -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;
}
}


Notiek ielāde…
Atcelt
Saglabāt