Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
AccountRelationMapper
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 */
13declare(strict_types=1);
14
15namespace Modules\Tasks\Models;
16
17use Modules\Admin\Models\AccountMapper;
18use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
19
20/**
21 * Mapper class.
22 *
23 * @package Modules\Tasks\Models
24 * @license OMS License 2.0
25 * @link    https://jingga.app
26 * @since   1.0.0
27 *
28 * @template T of AccountRelation
29 * @extends DataMapperFactory<T>
30 */
31final class AccountRelationMapper 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        'task_account_id'           => ['name' => 'task_account_id',           'type' => 'int', 'internal' => 'id'],
41        'task_account_duty'         => ['name' => 'task_account_duty',         'type' => 'int', 'internal' => 'duty'],
42        'task_account_account'      => ['name' => 'task_account_account',      'type' => 'int', 'internal' => 'relation'],
43        'task_account_task_element' => ['name' => 'task_account_task_element', 'type' => 'int', 'internal' => 'element'],
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        'relation' => [
54            'mapper'     => AccountMapper::class,
55            'external'   => 'task_account_account',
56        ],
57    ];
58
59    /**
60     * Primary table.
61     *
62     * @var string
63     * @since 1.0.0
64     */
65    public const TABLE = 'task_account';
66
67    /**
68     * Primary field name.
69     *
70     * @var string
71     * @since 1.0.0
72     */
73    public const PRIMARYFIELD = 'task_account_id';
74}