Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
ModuleMapper
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 */
13declare(strict_types=1);
14
15namespace Modules\Admin\Models;
16
17use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
18
19/**
20 * Module 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 Module
28 * @extends DataMapperFactory<T>
29 */
30final class ModuleMapper 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        'module_id'      => ['name' => 'module_id',     'type' => 'string', 'internal' => 'id'],
40        'module_name'    => ['name' => 'module_name', 'type' => 'string',    'internal' => 'name'],
41        'module_path'    => ['name' => 'module_path', 'type' => 'string',    'internal' => 'path'],
42        'module_theme'   => ['name' => 'module_theme', 'type' => 'string',    'internal' => 'theme'],
43        'module_version' => ['name' => 'module_version', 'type' => 'string',    'internal' => 'version'],
44        'module_status'  => ['name' => 'module_status', 'type' => 'int',    'internal' => 'status'],
45    ];
46
47    /**
48     * Primary table.
49     *
50     * @var string
51     * @since 1.0.0
52     */
53    public const TABLE = 'module';
54
55    /**
56     * Primary field name.
57     *
58     * @var string
59     * @since 1.0.0
60     */
61    public const PRIMARYFIELD = 'module_id';
62
63    public const AUTOINCREMENT = false;
64}