Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| CountryMapper | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package phpOMS\Localization\Defaults |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace phpOMS\Localization\Defaults; |
| 16 | |
| 17 | use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; |
| 18 | |
| 19 | /** |
| 20 | * Mapper class. |
| 21 | * |
| 22 | * @package phpOMS\Localization\Defaults |
| 23 | * @license OMS License 2.0 |
| 24 | * @link https://jingga.app |
| 25 | * @since 1.0.0 |
| 26 | * |
| 27 | * @template T of Country |
| 28 | * @extends DataMapperFactory<T> |
| 29 | */ |
| 30 | class CountryMapper extends DataMapperFactory |
| 31 | { |
| 32 | /** |
| 33 | * Columns. |
| 34 | * |
| 35 | * @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}> |
| 36 | * @since 1.0.0 |
| 37 | */ |
| 38 | public const COLUMNS = [ |
| 39 | 'country_id' => ['name' => 'country_id', 'type' => 'int', 'internal' => 'id'], |
| 40 | 'country_name' => ['name' => 'country_name', 'type' => 'string', 'internal' => 'name'], |
| 41 | 'country_code2' => ['name' => 'country_code2', 'type' => 'string', 'internal' => 'code2'], |
| 42 | 'country_code3' => ['name' => 'country_code3', 'type' => 'string', 'internal' => 'code3'], |
| 43 | 'country_numeric' => ['name' => 'country_numeric', 'type' => 'int', 'internal' => 'numeric'], |
| 44 | 'country_developed' => ['name' => 'country_developed', 'type' => 'bool', 'internal' => 'isDeveloped'], |
| 45 | ]; |
| 46 | |
| 47 | /** |
| 48 | * Primary table. |
| 49 | * |
| 50 | * @var string |
| 51 | * @since 1.0.0 |
| 52 | */ |
| 53 | public const TABLE = 'country'; |
| 54 | |
| 55 | /** |
| 56 | * Primary field name. |
| 57 | * |
| 58 | * @var string |
| 59 | * @since 1.0.0 |
| 60 | */ |
| 61 | public const PRIMARYFIELD = 'country_id'; |
| 62 | } |