From bc61fe9b21531288417e2e87ea9cbe3874ae2528 Mon Sep 17 00:00:00 2001 From: Jens Giessmann Date: Tue, 5 Nov 2019 13:50:58 +0100 Subject: [PATCH] make creation of the class name between model and crud generator more consistent --- src/commands/BatchController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/BatchController.php b/src/commands/BatchController.php index aad4fc00..12dfaefb 100644 --- a/src/commands/BatchController.php +++ b/src/commands/BatchController.php @@ -447,9 +447,14 @@ public function actionCruds() $this->createDirectoryFromNamespace($this->crudSearchModelNamespace); foreach ($this->tables as $table) { - $table = str_replace($this->tablePrefix, '', $table); - $name = isset($this->tableNameMap[$table]) ? $this->tableNameMap[$table] : - $this->modelGenerator->generateClassName($table); + + if (isset($this->tableNameMap[$table])) { + $tmp_name = $this->tableNameMap[$table]; + } else { + $tmp_name = str_replace($this->tablePrefix, '', $table); + } + $name = $this->modelGenerator->generateClassName($tmp_name); + $params = [ 'interactive' => $this->interactive, 'overwrite' => $this->overwrite,