mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-23 02:38:40 +00:00
prepare localization for profile
This commit is contained in:
parent
b7293ed9b1
commit
6bbe3f8f6f
|
|
@ -36,6 +36,48 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"currency": {
|
||||
"name": "currency",
|
||||
"fields": {
|
||||
"currency_id": {
|
||||
"name": "currency_id",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"currency_name": {
|
||||
"name": "currency_name",
|
||||
"type": "VARCHAR(100)",
|
||||
"null": false
|
||||
},
|
||||
"currency_num": {
|
||||
"name": "currency_num",
|
||||
"type": "VARCHAR(3)",
|
||||
"null": false
|
||||
},
|
||||
"currency_symbol": {
|
||||
"name": "currency_symbol",
|
||||
"type": "VARCHAR(5)",
|
||||
"null": false
|
||||
},
|
||||
"currency_char": {
|
||||
"name": "currency_char",
|
||||
"type": "VARCHAR(3)",
|
||||
"null": false
|
||||
},
|
||||
"currency_decimals": {
|
||||
"name": "currency_decimals",
|
||||
"type": "TINYINT(3)",
|
||||
"null": false
|
||||
},
|
||||
"currency_subunits": {
|
||||
"name": "currency_subunits",
|
||||
"type": "TINYINT(3)",
|
||||
"null": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"group": {
|
||||
"name": "group",
|
||||
"fields": {
|
||||
|
|
@ -155,18 +197,32 @@
|
|||
},
|
||||
"l11n_country": {
|
||||
"name": "l11n_country",
|
||||
"type": "VARCHAR(20)",
|
||||
"null": false
|
||||
"type": "INT(11)",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "country",
|
||||
"foreignKey": "country_id"
|
||||
},
|
||||
"l11n_language": {
|
||||
"name": "l11n_language",
|
||||
"type": "VARCHAR(20)",
|
||||
"type": "INT(11)",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "language",
|
||||
"foreignKey": "language_id"
|
||||
},
|
||||
"l11n_datetime": {
|
||||
"name": "l11n_datetime",
|
||||
"type": "INT(11)",
|
||||
"null": false
|
||||
},
|
||||
"l11n_currency": {
|
||||
"name": "l11n_currency",
|
||||
"type": "VARCHAR(20)",
|
||||
"null": false
|
||||
"type": "INT(11)",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "currency",
|
||||
"foreignKey": "currency_id"
|
||||
},
|
||||
"l11n_number_thousand": {
|
||||
"name": "l11n_number_thousand",
|
||||
|
|
|
|||
29
Models/Localization.php
Normal file
29
Models/Localization.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\Admin\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use phpOMS\Localization\Localization as FrameworkLocalization;
|
||||
|
||||
/**
|
||||
* Localization.
|
||||
*
|
||||
* @package Modules\Admin\Models
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Localization extends FrameworkLocalization
|
||||
{
|
||||
}
|
||||
86
Models/LocalizationMapper.php
Normal file
86
Models/LocalizationMapper.php
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\Admin\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Modules\Address\Models\CountryMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\Localization\Defaults\CurrencyMapper;
|
||||
use phpOMS\Localization\Defaults\LanguageMapper;
|
||||
|
||||
/**
|
||||
* Localization mapper.
|
||||
*
|
||||
* @package Modules\Admin\Models
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class LocalizationMapper extends DataMapperAbstract
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array<string, bool|string|array>>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
'l11n_id' => ['name' => 'l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'l11n_country' => ['name' => 'l11n_country', 'type' => 'int', 'internal' => 'country'],
|
||||
'l11n_language' => ['name' => 'l11n_language', 'type' => 'int', 'internal' => 'language'],
|
||||
'l11n_currency' => ['name' => 'l11n_currency', 'type' => 'int', 'internal' => 'currency'],
|
||||
'l11n_datetime' => ['name' => 'l11n_datetime', 'type' => 'int', 'internal' => 'datetime'],
|
||||
'l11n_number_thousand' => ['name' => 'l11n_number_thousand', 'type' => 'string', 'internal' => 'thousands'],
|
||||
'l11n_number_decimal' => ['name' => 'l11n_number_decimal', 'type' => 'string', 'internal' => 'decimal'],
|
||||
'l11n_angle' => ['name' => 'l11n_angle', 'type' => 'string', 'internal' => 'angle'],
|
||||
'l11n_temperature' => ['name' => 'l11n_temperature', 'type' => 'string', 'internal' => 'temperature'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Has one relation.
|
||||
*
|
||||
* @var array<string, array<string, string>>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $ownsOne = [
|
||||
'country' => [
|
||||
'mapper' => CountryMapper::class,
|
||||
'src' => 'l11n_country',
|
||||
],
|
||||
'language' => [
|
||||
'mapper' => LanguageMapper::class,
|
||||
'src' => 'l11n_language',
|
||||
],
|
||||
'currency' => [
|
||||
'mapper' => CurrencyMapper::class,
|
||||
'src' => 'l11n_currency',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'l11n';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'l11n_id';
|
||||
}
|
||||
27
Models/NullLocalization.php
Normal file
27
Models/NullLocalization.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\Admin\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
/**
|
||||
* Localization.
|
||||
*
|
||||
* @package Modules\Admin\Models
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class NullLocalization extends Localization
|
||||
{
|
||||
}
|
||||
|
|
@ -14,6 +14,10 @@ declare(strict_types=1);
|
|||
|
||||
return [
|
||||
'Admin' => [
|
||||
':s1' => 'Active',
|
||||
':s2' => 'Inactive',
|
||||
':s3' => 'Timeout',
|
||||
':s4' => 'Banned',
|
||||
'Account' => 'Account',
|
||||
'Account/Group' => 'Account/Group',
|
||||
'Accounts' => 'Accounts',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user