repository = $repository; } /** * @param int $orderId * @param $warehouseId * @param $type * @throws CannotUpdateOrderWarehouseException */ public function execute(int $orderId, $warehouseId, $type){ try { $this->repository->updateOrCreate(['order_id' => $orderId, 'type' =>$type], ['warehouse_id' => $warehouseId]); } catch (\Exception $exception){ throw new CannotUpdateOrderWarehouseException($exception->getMessage()); } } }