Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
BillAttributeValueMapper
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 */
13declare(strict_types=1);
14
15namespace Modules\Billing\Models\Attribute;
16
17use Modules\Attribute\Models\AttributeValue;
18use 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 AttributeValue
29 * @extends DataMapperFactory<T>
30 */
31final class BillAttributeValueMapper 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_attr_value_id'                => ['name' => 'billing_attr_value_id',       'type' => 'int',      'internal' => 'id'],
41        'billing_attr_value_default'           => ['name' => 'billing_attr_value_default',  'type' => 'bool',     'internal' => 'isDefault'],
42        'billing_attr_value_valueStr'          => ['name' => 'billing_attr_value_valueStr', 'type' => 'string',   'internal' => 'valueStr'],
43        'billing_attr_value_valueInt'          => ['name' => 'billing_attr_value_valueInt', 'type' => 'int',      'internal' => 'valueInt'],
44        'billing_attr_value_valueDec'          => ['name' => 'billing_attr_value_valueDec', 'type' => 'float',    'internal' => 'valueDec'],
45        'billing_attr_value_valueDat'          => ['name' => 'billing_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
46        'billing_attr_value_unit'              => ['name' => 'billing_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
47        'billing_attr_value_deptype'           => ['name' => 'billing_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
48        'billing_attr_value_depvalue'          => ['name' => 'billing_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
49    ];
50
51    /**
52     * Has many relation.
53     *
54     * @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
55     * @since 1.0.0
56     */
57    public const HAS_MANY = [
58        'l11n' => [
59            'mapper'   => BillAttributeValueL11nMapper::class,
60            'table'    => 'billing_attr_value_l11n',
61            'self'     => 'billing_attr_value_l11n_value',
62            'external' => null,
63        ],
64    ];
65
66    /**
67     * Model to use by the mapper.
68     *
69     * @var class-string<T>
70     * @since 1.0.0
71     */
72    public const MODEL = AttributeValue::class;
73
74    /**
75     * Primary table.
76     *
77     * @var string
78     * @since 1.0.0
79     */
80    public const TABLE = 'billing_attr_value';
81
82    /**
83     * Primary field name.
84     *
85     * @var string
86     * @since 1.0.0
87     */
88    public const PRIMARYFIELD = 'billing_attr_value_id';
89}