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.

27 lines
924B

  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use App\Entity\Order\OrderStatusHistory;
  4. use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
  5. use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface;
  6. use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryModel;
  7. use Lc\CaracoleBundle\Model\Order\OrderStatusInterface;
  8. use Lc\SovBundle\Factory\AbstractFactory;
  9. class OrderStatusHistoryFactory extends AbstractFactory
  10. {
  11. public function create(OrderShopInterface $orderShop, OrderStatusInterface $status, string $origin = OrderStatusHistoryModel::ORIGIN_USER): OrderStatusHistoryInterface
  12. {
  13. $orderStatusHistory = new OrderStatusHistory();
  14. $orderStatusHistory->setOrderShop($orderShop);
  15. $orderStatusHistory->setOrderStatus($status);
  16. $orderStatusHistory->setOrigin($origin);
  17. $orderStatusHistory->setCreatedAt(new \DateTime());
  18. return $orderStatusHistory;
  19. }
  20. }