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.

OrderProductFactory.php 659B

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use App\Entity\Order\OrderProduct;
  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. return new OrderProduct();
  18. }
  19. }