You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
735B

  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use Lc\CaracoleBundle\Container\Order\OrderProductContainer;
  4. use Lc\CaracoleBundle\Model\Order\OrderProductInterface;
  5. use Lc\CaracoleBundle\Model\Product\ProductInterface;
  6. use Lc\SovBundle\Factory\AbstractFactory;
  7. class OrderProductFactory extends AbstractFactory
  8. {
  9. public function create(ProductInterface $product, int $quantityOrder): OrderProductInterface
  10. {
  11. $orderProduct = $this->createBase();
  12. $orderProduct->setProduct($product);
  13. $orderProduct->setQuantityOrder($quantityOrder);
  14. return $orderProduct;
  15. }
  16. public function createBase(){
  17. $class = OrderProductContainer::getEntityFqcn();
  18. return new $class;
  19. }
  20. }