|
@@ -93,7 +93,7 @@ discard block |
|
|
block discarded – undo |
|
93
|
93
|
|
|
94
|
94
|
$modelName = ucfirst(Str::singular($object->name)); |
|
95
|
95
|
|
|
96
|
|
- $model = $namespace . '\\' . $modelName; |
|
|
96
|
+ $model = $namespace.'\\'.$modelName; |
|
97
|
97
|
$object->model = $model; |
|
98
|
98
|
} |
|
99
|
99
|
|
|
@@ -105,7 +105,7 @@ discard block |
|
|
block discarded – undo |
|
105
|
105
|
$table = Table::getTable($tableName); |
|
106
|
106
|
|
|
107
|
107
|
$modelName = ucfirst(Str::singular($table['name'])); |
|
108
|
|
- $model = $namespace . '\\' . $modelName; |
|
|
108
|
+ $model = $namespace.'\\'.$modelName; |
|
109
|
109
|
|
|
110
|
110
|
$object = new \stdClass; |
|
111
|
111
|
$object->name = $table['name']; |
|
@@ -234,7 +234,7 @@ discard block |
|
|
block discarded – undo |
|
234
|
234
|
if ($table['makeModel'] == true && !class_exists($table['model'])) { |
|
235
|
235
|
\DBM::makeModel($table['model'], $table['name']); |
|
236
|
236
|
} else if ($table['makeModel'] == false && !class_exists($table['model'])) { |
|
237
|
|
- $error = "Create model '" . $table['model'] . "' first or checked create model option"; |
|
|
237
|
+ $error = "Create model '".$table['model']."' first or checked create model option"; |
|
238
|
238
|
return $this->generateError([$error]); |
|
239
|
239
|
} |
|
240
|
240
|
|
|
@@ -254,7 +254,7 @@ discard block |
|
|
block discarded – undo |
|
254
|
254
|
// $action = ($request->isCrudExists) ? 'edit' : 'add'; |
|
255
|
255
|
$permission = $request->isCrudExists ? 'update' : 'create'; |
|
256
|
256
|
|
|
257
|
|
- if (($response = DBM::authorize('crud.' . $permission)) !== true) { |
|
|
257
|
+ if (($response = DBM::authorize('crud.'.$permission)) !== true) { |
|
258
|
258
|
return $response; |
|
259
|
259
|
} |
|
260
|
260
|
|
|
@@ -326,7 +326,7 @@ discard block |
|
|
block discarded – undo |
|
326
|
326
|
$prefix = (Driver::isMongoDB()) ? "_" : ""; |
|
327
|
327
|
|
|
328
|
328
|
foreach ($fields as $fld) { |
|
329
|
|
- if ($fld->id == $field->{$prefix . "id"}) { |
|
|
329
|
+ if ($fld->id == $field->{$prefix."id"}) { |
|
330
|
330
|
|
|
331
|
331
|
$relationship = $fld->settings; |
|
332
|
332
|
$localTable = $relationship['localTable']; |
|
@@ -360,17 +360,17 @@ discard block |
|
|
block discarded – undo |
|
360
|
360
|
|
|
361
|
361
|
if (!class_exists($relationship['localModel'])) { |
|
362
|
362
|
|
|
363
|
|
- $error = $relationship['localModel'] . " Model not found. Please create the " . $relationship['localModel'] . " model first"; |
|
|
363
|
+ $error = $relationship['localModel']." Model not found. Please create the ".$relationship['localModel']." model first"; |
|
364
|
364
|
return $this->generateError([$error]); |
|
365
|
365
|
} |
|
366
|
366
|
|
|
367
|
367
|
if (!class_exists($relationship['foreignModel'])) { |
|
368
|
368
|
|
|
369
|
|
- $error = $relationship['foreignModel'] . " Model not found. Please create the " . $relationship['foreignModel'] . " model first"; |
|
|
369
|
+ $error = $relationship['foreignModel']." Model not found. Please create the ".$relationship['foreignModel']." model first"; |
|
370
|
370
|
return $this->generateError([$error]); |
|
371
|
371
|
} |
|
372
|
372
|
|
|
373
|
|
- $fieldName = strtolower(Str::singular($relationship['localTable']) . '_' . $relationship['type'] . '_' . Str::singular($relationship['foreignTable']) . '_relationship'); |
|
|
373
|
+ $fieldName = strtolower(Str::singular($relationship['localTable']).'_'.$relationship['type'].'_'.Str::singular($relationship['foreignTable']).'_relationship'); |
|
374
|
374
|
$settings = [ |
|
375
|
375
|
'relationType' => $relationship['type'], |
|
376
|
376
|
'localModel' => $relationship['localModel'], |