Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
TaskAttributeMapper | 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\Tasks\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\Tasks\Models; |
16 | |
17 | use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; |
18 | |
19 | /** |
20 | * Task mapper class. |
21 | * |
22 | * @package Modules\Tasks\Models |
23 | * @license OMS License 2.0 |
24 | * @link https://jingga.app |
25 | * @since 1.0.0 |
26 | * |
27 | * @template T of TaskAttribute |
28 | * @extends DataMapperFactory<T> |
29 | */ |
30 | final class TaskAttributeMapper 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 | 'task_attr_id' => ['name' => 'task_attr_id', 'type' => 'int', 'internal' => 'id'], |
40 | 'task_attr_task' => ['name' => 'task_attr_task', 'type' => 'int', 'internal' => 'task'], |
41 | 'task_attr_type' => ['name' => 'task_attr_type', 'type' => 'int', 'internal' => 'type'], |
42 | 'task_attr_value' => ['name' => 'task_attr_value', 'type' => 'int', 'internal' => 'value'], |
43 | ]; |
44 | |
45 | /** |
46 | * Has one relation. |
47 | * |
48 | * @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}> |
49 | * @since 1.0.0 |
50 | */ |
51 | public const OWNS_ONE = [ |
52 | 'type' => [ |
53 | 'mapper' => TaskAttributeTypeMapper::class, |
54 | 'external' => 'task_attr_type', |
55 | ], |
56 | 'value' => [ |
57 | 'mapper' => TaskAttributeValueMapper::class, |
58 | 'external' => 'task_attr_value', |
59 | ], |
60 | ]; |
61 | |
62 | /** |
63 | * Primary table. |
64 | * |
65 | * @var string |
66 | * @since 1.0.0 |
67 | */ |
68 | public const TABLE = 'task_attr'; |
69 | |
70 | /** |
71 | * Primary field name. |
72 | * |
73 | * @var string |
74 | * @since 1.0.0 |
75 | */ |
76 | public const PRIMARYFIELD = 'task_attr_id'; |
77 | } |