|
@@ -163,15 +163,20 @@ WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'informat
|
163
|
163
|
$this->buildTwig('dbo.php', $file, $vars);
|
164
|
164
|
}
|
165
|
165
|
|
166
|
|
- public function generateModel($modelName, $dboName, $columns, $file, $namespace)
|
|
166
|
+ public function generateModel($modelName, $modelUserName, $dboName, $columns, $file, $fileUser, $namespace)
|
167
|
167
|
{
|
168
|
168
|
$vars = array(
|
169
|
169
|
"model_name" => $modelName,
|
|
170
|
+ "model_user_name" => $modelUserName,
|
170
|
171
|
"dbo_name" => $dboName,
|
171
|
172
|
"columns" => $columns,
|
172
|
173
|
"namespace" => $namespace
|
173
|
174
|
);
|
174
|
175
|
$this->buildTwig('model.php', $file, $vars);
|
|
176
|
+
|
|
177
|
+ if (file_exists($fileUser))
|
|
178
|
+ return;
|
|
179
|
+ $this->buildTwig('model_user.php', $fileUser, $vars);
|
175
|
180
|
}
|
176
|
181
|
|
177
|
182
|
public function getStoredProcedures()
|
|
@@ -289,14 +294,15 @@ ORDER BY parameters.ordinal_position;");
|
289
|
294
|
continue;
|
290
|
295
|
$columns = $this->sqlTypesToPhpTypes($columns);
|
291
|
296
|
$baseName = $this->snakeToCamelCase($table_name, true);
|
292
|
|
- $modelName = $baseName;
|
|
297
|
+ $modelName = $baseName . "Model";
|
|
298
|
+ $modelUserName = $baseName;
|
293
|
299
|
$dboName = $baseName . "Dbo";
|
294
|
300
|
$dataAccessName = $baseName . "DataAccess";
|
295
|
301
|
$businessName = $baseName . "Business";
|
296
|
302
|
$this->generateDbo($dboName, $columns, $dbo_dir . $dboName . ".php",
|
297
|
303
|
$this->_config["dbo"]["namespace"]);
|
298
|
|
- $this->generateModel($modelName, $dboName, $columns, $model_dir . $modelName . ".php",
|
299
|
|
- $this->_config["models"]["namespace"]);
|
|
304
|
+ $this->generateModel($modelName, $modelUserName, $dboName, $columns, $model_dir . $modelName . ".php",
|
|
305
|
+ $model_dir . $modelUserName . ".php", $this->_config["models"]["namespace"]);
|
300
|
306
|
$this->generateDataAccess($dataAccessName, $modelName, $dboName,
|
301
|
307
|
$manager_dir . $dataAccessName . ".php", $this->_config["dataaccess"]["namespace"]);
|
302
|
308
|
$this->generateBusiness($businessName, $dataAccessName, $dboName,
|