@omnifyjp/ts 8.0.1 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -422,6 +422,16 @@ class FileLocales
|
|
|
422
422
|
public const PROPERTY_DISPLAY_NAMES = [
|
|
423
423
|
${propertyNamesPhp},
|
|
424
424
|
];
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Localized display names for properties, widened to the declared shape.
|
|
428
|
+
*
|
|
429
|
+
* @return array<string, array<string, string>>
|
|
430
|
+
*/
|
|
431
|
+
public static function propertyDisplayNames(): array
|
|
432
|
+
{
|
|
433
|
+
return self::PROPERTY_DISPLAY_NAMES;
|
|
434
|
+
}
|
|
425
435
|
}
|
|
426
436
|
`;
|
|
427
437
|
return baseFile(resolveModularBasePath(config, 'File', 'Locales', 'FileLocales.php', config.models.basePath + '/Locales'), content);
|
|
@@ -47,6 +47,16 @@ class ${modelName}Locales
|
|
|
47
47
|
* @var array<string, array<string, string>>
|
|
48
48
|
*/
|
|
49
49
|
public const PROPERTY_DISPLAY_NAMES = ${propertyDisplayNamesPhp};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Localized display names for properties, widened to the declared shape.
|
|
53
|
+
*
|
|
54
|
+
* @return array<string, array<string, string>>
|
|
55
|
+
*/
|
|
56
|
+
public static function propertyDisplayNames(): array
|
|
57
|
+
{
|
|
58
|
+
return self::PROPERTY_DISPLAY_NAMES;
|
|
59
|
+
}
|
|
50
60
|
}
|
|
51
61
|
`;
|
|
52
62
|
return baseFile(resolveModularBasePath(config, name, 'Locales', `${modelName}Locales.php`, config.models.basePath + '/Locales'), content);
|
|
@@ -244,7 +244,7 @@ function generateBaseRequest(name, schema, reader, config, action) {
|
|
|
244
244
|
' {',
|
|
245
245
|
" $locale = app()->getLocale();",
|
|
246
246
|
" $fallback = config('app.fallback_locale', 'en');",
|
|
247
|
-
` $propertyNames = ${modelName}Locales::
|
|
247
|
+
` $propertyNames = ${modelName}Locales::propertyDisplayNames();`,
|
|
248
248
|
' $attributes = [];',
|
|
249
249
|
'',
|
|
250
250
|
' $keys = [',
|
|
@@ -1158,7 +1158,7 @@ ${listExample}
|
|
|
1158
1158
|
// disable LIMIT (whole-table dump) and a huge one is unbounded.
|
|
1159
1159
|
lines.push(`
|
|
1160
1160
|
$perPage = filter_var($filters['per_page'] ?? null, FILTER_VALIDATE_INT);
|
|
1161
|
-
$perPage = $perPage === false
|
|
1161
|
+
$perPage = $perPage === false ? ${perPage} : $perPage;
|
|
1162
1162
|
$perPage = max(1, min($perPage, ${maxPerPage}));
|
|
1163
1163
|
|
|
1164
1164
|
return $query->paginate($perPage);
|