|
123456789101112131415161718192021222324252627 |
- <?php
-
- namespace Lc\CaracoleBundle\Factory\Order;
-
- use Lc\CaracoleBundle\Container\Order\OrderStatusHistoryContainer;
- use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
- use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface;
- use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryModel;
- use Lc\CaracoleBundle\Model\Order\OrderStatusInterface;
- use Lc\SovBundle\Factory\AbstractFactory;
-
- class OrderStatusHistoryFactory extends AbstractFactory
- {
- public function create(OrderShopInterface $orderShop, OrderStatusInterface $status, string $origin = OrderStatusHistoryModel::ORIGIN_USER): OrderStatusHistoryInterface
- {
- $class = OrderStatusHistoryContainer::getEntityFqcn();
- $orderStatusHistory = new $class;
-
- $orderStatusHistory->setOrderShop($orderShop);
- $orderStatusHistory->setOrderStatus($status);
- $orderStatusHistory->setOrigin($origin);
- $orderStatusHistory->setCreatedAt(new \DateTime());
-
- return $orderStatusHistory;
- }
-
- }
|