Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
App | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
toArray | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
jsonSerialize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
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 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace Modules\Admin\Models; |
16 | |
17 | use phpOMS\Application\ApplicationStatus; |
18 | use phpOMS\Application\ApplicationType; |
19 | |
20 | /** |
21 | * App model. |
22 | * |
23 | * @package Modules\Admin\Models |
24 | * @license OMS License 2.0 |
25 | * @link https://jingga.app |
26 | * @since 1.0.0 |
27 | */ |
28 | class App implements \JsonSerializable |
29 | { |
30 | /** |
31 | * Id |
32 | * |
33 | * @var int |
34 | * @since 1.0.0 |
35 | */ |
36 | public int $id = 0; |
37 | |
38 | /** |
39 | * Name |
40 | * |
41 | * @var string |
42 | * @since 1.0.0 |
43 | */ |
44 | public string $name = ''; |
45 | |
46 | /** |
47 | * Theme |
48 | * |
49 | * @var string |
50 | * @since 1.0.0 |
51 | */ |
52 | public string $theme = ''; |
53 | |
54 | /** |
55 | * Status |
56 | * |
57 | * @var int |
58 | * @since 1.0.0 |
59 | */ |
60 | public int $status = ApplicationStatus::NORMAL; |
61 | |
62 | /** |
63 | * Status |
64 | * |
65 | * @var int |
66 | * @since 1.0.0 |
67 | */ |
68 | public int $type = ApplicationType::WEB; |
69 | |
70 | /** |
71 | * Default unit |
72 | * |
73 | * @var null|int |
74 | * @since 1.0.0 |
75 | */ |
76 | public ?int $defaultUnit = null; |
77 | |
78 | /** |
79 | * {@inheritdoc} |
80 | */ |
81 | public function toArray() : array |
82 | { |
83 | return [ |
84 | 'id' => $this->id, |
85 | 'name' => $this->name, |
86 | 'type' => $this->type, |
87 | 'status' => $this->status, |
88 | ]; |
89 | } |
90 | |
91 | /** |
92 | * {@inheritdoc} |
93 | */ |
94 | public function jsonSerialize() : mixed |
95 | { |
96 | return $this->toArray(); |
97 | } |
98 | } |