src/Backend/Modules/Commerce/Domain/PaymentMethod/Checkout/ConfirmOrder.php
/**
     * Create a update order status.
     *
     * @throws OrderStatusNotFound
     */
Create a update order status.
Create a update order status .
protected function updateOrderStatus(Order $order, int $statusId): void
    {
        $createOrderHistory = new CreateOrderHistory();
        $createOrderHistory->order = $order;
        $createOrderHistory->orderStatus = $this->getOrderStatus($statusId);
        $this->commandBus->handle($createOrderHistory);
        $this->eventDispatcher->dispatch(
            OrderUpdated::EVENT_NAME,
            new OrderUpdated($order, $createOrderHistory->getOrderHistoryEntity())
        );
    }
protected function updateOrderStatus ( Order $ order , int $ statusId ) : void { $ createOrderHistory = new CreateOrderHistory ( ) ; $ createOrderHistory -> order = $ order ; $ createOrderHistory -> orderStatus = $ this -> getOrderStatus ( $ statusId ) ; $ this -> commandBus -> handle ( $ createOrderHistory ) ; $ this -> eventDispatcher -> dispatch ( OrderUpdated :: EVENT_NAME , new OrderUpdated ( $ order , $ createOrderHistory -> getOrderHistoryEntity ( ) ) ) ; }
Create a update order status.
Create a update order status .
// Trigger an event to notify or not