repository = $repository; } /** * @param OrderObject $order * @throws CannotUpdateOrderWarehouseException */ public function execute(OrderObject $order){ try { /** @var Order $repository */ $repository = $this->repository->findOrFail($order->getOrderId()); $repository->warehouse_id = $order->getWarehouseId(); $repository->save(); } catch (\Exception $exception){ throw new CannotUpdateOrderWarehouseException($exception->getMessage()); } } }