Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
|
- <?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;
- }
- }
|