您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

29 行
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. }