Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
AppMapper | 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 Modules\Admin\Models |
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 Modules\Admin\Models; |
16 | |
17 | use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; |
18 | |
19 | /** |
20 | * Account mapper class. |
21 | * |
22 | * @package Modules\Admin\Models |
23 | * @license OMS License 2.0 |
24 | * @link https://jingga.app |
25 | * @since 1.0.0 |
26 | * |
27 | * @template T of App |
28 | * @extends DataMapperFactory<T> |
29 | */ |
30 | final class AppMapper 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 | 'app_id' => ['name' => 'app_id', 'type' => 'int', 'internal' => 'id'], |
40 | 'app_name' => ['name' => 'app_name', 'type' => 'string', 'internal' => 'name'], |
41 | 'app_theme' => ['name' => 'app_theme', 'type' => 'string', 'internal' => 'theme'], |
42 | 'app_status' => ['name' => 'app_status', 'type' => 'int', 'internal' => 'status'], |
43 | 'app_type' => ['name' => 'app_type', 'type' => 'int', 'internal' => 'type'], |
44 | 'app_unit_default' => ['name' => 'app_unit_default', 'type' => 'int', 'internal' => 'defaultUnit'], |
45 | ]; |
46 | |
47 | /** |
48 | * Model to use by the mapper. |
49 | * |
50 | * @var class-string<T> |
51 | * @since 1.0.0 |
52 | */ |
53 | public const MODEL = App::class; |
54 | |
55 | /** |
56 | * Primary table. |
57 | * |
58 | * @var string |
59 | * @since 1.0.0 |
60 | */ |
61 | public const TABLE = 'app'; |
62 | |
63 | /** |
64 | * Primary field name. |
65 | * |
66 | * @var string |
67 | * @since 1.0.0 |
68 | */ |
69 | public const PRIMARYFIELD = 'app_id'; |
70 | } |