From 23eb997a61730857e7e4375aceae76b3f953c717 Mon Sep 17 00:00:00 2001 From: Samuel Asor <8720569+sammyskills@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:16:28 +0100 Subject: [PATCH] applied code review suggestion --- system/Commands/Generators/ModelGenerator.php | 5 +---- system/Commands/Generators/Views/model.tpl.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/system/Commands/Generators/ModelGenerator.php b/system/Commands/Generators/ModelGenerator.php index cb22ffbbf963..eb0a1aa9802f 100644 --- a/system/Commands/Generators/ModelGenerator.php +++ b/system/Commands/Generators/ModelGenerator.php @@ -101,9 +101,6 @@ protected function prepare(string $class): string $baseClass = $match[1]; } - // Add or remove the DBGroup line based on the presence of the dbgroup option - $addDBGroupLine = is_string($dbGroup); - $table = is_string($table) ? $table : plural(strtolower($baseClass)); $return = is_string($return) ? $return : 'array'; @@ -131,6 +128,6 @@ protected function prepare(string $class): string $return = "'{$return}'"; } - return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('addDBGroupLine')); + return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('dbGroup')); } } diff --git a/system/Commands/Generators/Views/model.tpl.php b/system/Commands/Generators/Views/model.tpl.php index 7bf7676f320f..b9b9c99eb560 100644 --- a/system/Commands/Generators/Views/model.tpl.php +++ b/system/Commands/Generators/Views/model.tpl.php @@ -6,7 +6,7 @@ class {class} extends Model { - + protected $DBGroup = '{dbGroup}'; protected $table = '{table}';