Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
BillAttributeMapper | 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\Billing\Models\Attribute |
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\Billing\Models\Attribute; |
16 | |
17 | use Modules\Attribute\Models\Attribute; |
18 | use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; |
19 | |
20 | /** |
21 | * Bill mapper class. |
22 | * |
23 | * @package Modules\Billing\Models\Attribute |
24 | * @license OMS License 2.0 |
25 | * @link https://jingga.app |
26 | * @since 1.0.0 |
27 | * |
28 | * @template T of Attribute |
29 | * @extends DataMapperFactory<T> |
30 | */ |
31 | final class BillAttributeMapper extends DataMapperFactory |
32 | { |
33 | /** |
34 | * Columns. |
35 | * |
36 | * @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}> |
37 | * @since 1.0.0 |
38 | */ |
39 | public const COLUMNS = [ |
40 | 'billing_bill_attr_id' => ['name' => 'billing_bill_attr_id', 'type' => 'int', 'internal' => 'id'], |
41 | 'billing_bill_attr_bill' => ['name' => 'billing_bill_attr_bill', 'type' => 'int', 'internal' => 'ref'], |
42 | 'billing_bill_attr_type' => ['name' => 'billing_bill_attr_type', 'type' => 'int', 'internal' => 'type'], |
43 | 'billing_bill_attr_value' => ['name' => 'billing_bill_attr_value', 'type' => 'int', 'internal' => 'value'], |
44 | ]; |
45 | |
46 | /** |
47 | * Has one relation. |
48 | * |
49 | * @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}> |
50 | * @since 1.0.0 |
51 | */ |
52 | public const OWNS_ONE = [ |
53 | 'type' => [ |
54 | 'mapper' => BillAttributeTypeMapper::class, |
55 | 'external' => 'billing_bill_attr_type', |
56 | ], |
57 | 'value' => [ |
58 | 'mapper' => BillAttributeValueMapper::class, |
59 | 'external' => 'billing_bill_attr_value', |
60 | ], |
61 | ]; |
62 | |
63 | /** |
64 | * Model to use by the mapper. |
65 | * |
66 | * @var class-string<T> |
67 | * @since 1.0.0 |
68 | */ |
69 | public const MODEL = Attribute::class; |
70 | |
71 | /** |
72 | * Primary table. |
73 | * |
74 | * @var string |
75 | * @since 1.0.0 |
76 | */ |
77 | public const TABLE = 'billing_bill_attr'; |
78 | |
79 | /** |
80 | * Primary field name. |
81 | * |
82 | * @var string |
83 | * @since 1.0.0 |
84 | */ |
85 | public const PRIMARYFIELD = 'billing_bill_attr_id'; |
86 | } |