From db50fd8a72e585163aa55dec9a8550fa524caac7 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 29 Apr 2025 12:53:21 +0200 Subject: [PATCH] fixed new model classes without model --- application/WarehouseHistory/WarehouseHistoryController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/WarehouseHistory/WarehouseHistoryController.php b/application/WarehouseHistory/WarehouseHistoryController.php index e52dcbccd..5691222bf 100644 --- a/application/WarehouseHistory/WarehouseHistoryController.php +++ b/application/WarehouseHistory/WarehouseHistoryController.php @@ -3,8 +3,7 @@ class WarehouseHistoryController { public function create($postData, $mod) { - $modelClass = $mod . 'Model'; - $modelClass = new $modelClass(); + $modelClass = class_exists($mod . 'Model') ? new ($mod . 'Model')() : new $mod(); $currentData = $modelClass::get($postData['id']); $me = new User(); $me->loadMe();