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.

30 lines
868B

  1. <?php
  2. namespace domain\Order\OrderStatusHistory;
  3. use domain\_\AbstractManager;
  4. use domain\Order\Order\Order;
  5. use domain\Order\OrderStatus\OrderStatus;
  6. use domain\User\User\User;
  7. class OrderStatusHistoryManager extends AbstractManager
  8. {
  9. protected OrderStatusHistoryBuilder $orderStatusHistoryBuilder;
  10. public function loadDependencies(): void
  11. {
  12. $this->orderStatusHistoryBuilder = $this->loadService(OrderStatusHistoryBuilder::class);
  13. }
  14. public function create(
  15. Order $order,
  16. OrderStatus $orderStatus,
  17. \DateTime $date,
  18. User $user
  19. ): OrderStatusHistory
  20. {
  21. $orderStatusHistory = $this->orderStatusHistoryBuilder->instanciateOrderStatusHistory($order, $orderStatus, $date, $user);
  22. $this->orderStatusHistoryBuilder->create($orderStatusHistory);
  23. return $orderStatusHistory;
  24. }
  25. }