Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
|
- <?php
-
- namespace Lc\CaracoleBundle\Factory\Product;
-
- use App\Entity\Product\ProductFamily;
- use Lc\CaracoleBundle\Context\SectionContextTrait;
- use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
- use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
- use Lc\CaracoleBundle\Model\Section\SectionInterface;
- use Lc\SovBundle\Factory\AbstractFactory;
-
- class ProductFamilyFactory extends AbstractFactory
- {
- public function create(MerchantInterface $merchant): ProductFamilyInterface
- {
- $productFamily = new ProductFamily();
-
- $productFamily->setSaleStatus(true);
- $productFamily->setStatus(1);
-
- $productFamilySectionPropertyFactory = new ProductFamilySectionPropertyFactory();
-
- foreach($merchant->getSections() as $section) {
- $productFamilySectionProperty = $productFamilySectionPropertyFactory->create($section, $productFamily);
- $productFamily->addProductFamilySectionProperty($productFamilySectionProperty);
- }
-
- return $productFamily;
- }
- }
|