|
12345678910111213141516171819202122232425262728 |
- <?php
-
- namespace Lc\CaracoleBundle\Factory\Order;
-
-
- use Lc\CaracoleBundle\Container\Order\OrderProductContainer;
- use Lc\CaracoleBundle\Model\Order\OrderProductInterface;
- use Lc\CaracoleBundle\Model\Product\ProductInterface;
- use Lc\SovBundle\Factory\AbstractFactory;
-
- class OrderProductFactory extends AbstractFactory
- {
- public function create(ProductInterface $product, int $quantityOrder): OrderProductInterface
- {
- $orderProduct = $this->createBase();
-
- $orderProduct->setProduct($product);
- $orderProduct->setQuantityOrder($quantityOrder);
-
- return $orderProduct;
- }
-
- public function createBase(){
- $class = OrderProductContainer::getEntityFqcn();
- return new $class;
- }
-
- }
|