Browse Source

Ajout méthode getSection()

packProduct
Guillaume 3 years ago
parent
commit
1c5b2acd59
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      Solver/Product/ProductFamilySolver.php

+ 11
- 0
Solver/Product/ProductFamilySolver.php View File

use Lc\CaracoleBundle\Model\Product\ProductFamilyModel; use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
use Lc\CaracoleBundle\Model\Product\ProductInterface; use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;


class ProductFamilySolver class ProductFamilySolver
{ {
return false; return false;
} }


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

return null;
}
} }



Loading…
Cancel
Save