Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| CityMapper | 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 City |
| 28 | * @extends DataMapperFactory<T> |
| 29 | */ |
| 30 | class CityMapper 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 | 'city_id' => ['name' => 'city_id', 'type' => 'int', 'internal' => 'id'], |
| 40 | 'city_city' => ['name' => 'city_city', 'type' => 'string', 'internal' => 'name'], |
| 41 | 'city_country' => ['name' => 'city_country', 'type' => 'string', 'internal' => 'countryCode'], |
| 42 | 'city_state' => ['name' => 'city_state', 'type' => 'string', 'internal' => 'state'], |
| 43 | 'city_postal' => ['name' => 'city_postal', 'type' => 'int', 'internal' => 'postal'], |
| 44 | 'city_lat' => ['name' => 'city_lat', 'type' => 'float', 'internal' => 'lat'], |
| 45 | 'city_long' => ['name' => 'city_long', 'type' => 'float', 'internal' => 'long'], |
| 46 | ]; |
| 47 | |
| 48 | /** |
| 49 | * Primary table. |
| 50 | * |
| 51 | * @var string |
| 52 | * @since 1.0.0 |
| 53 | */ |
| 54 | public const TABLE = 'city'; |
| 55 | |
| 56 | /** |
| 57 | * Primary field name. |
| 58 | * |
| 59 | * @var string |
| 60 | * @since 1.0.0 |
| 61 | */ |
| 62 | public const PRIMARYFIELD = 'city_id'; |
| 63 | } |