Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
Subscription | |
0.00% |
0 / 6 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
toArray | |
0.00% |
0 / 3 |
|
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\Billing\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\Billing\Models; |
16 | |
17 | use phpOMS\Stdlib\Base\FloatInt; |
18 | |
19 | /** |
20 | * Subscription class. |
21 | * |
22 | * @package Modules\Billing\Models |
23 | * @license OMS License 2.0 |
24 | * @link https://jingga.app |
25 | * @since 1.0.0 |
26 | */ |
27 | class Subscription implements \JsonSerializable |
28 | { |
29 | /** |
30 | * ID. |
31 | * |
32 | * @var int |
33 | * @since 1.0.0 |
34 | */ |
35 | public int $id = 0; |
36 | |
37 | public int $status = 0; |
38 | |
39 | public \DateTime $start; |
40 | |
41 | public ?\DateTime $end = null; |
42 | |
43 | public FloatInt $price; |
44 | |
45 | public int $bill = 0; |
46 | |
47 | public int $item = 0; |
48 | |
49 | public bool $autoRenew = false; |
50 | |
51 | public int $client = 0; |
52 | |
53 | public int $quantity = 0; |
54 | |
55 | /** |
56 | * Constructor. |
57 | * |
58 | * @since 1.0.0 |
59 | */ |
60 | public function __construct() |
61 | { |
62 | $price = new FloatInt(); |
63 | } |
64 | |
65 | /** |
66 | * Get id. |
67 | * |
68 | * @return int Model id |
69 | * |
70 | * @since 1.0.0 |
71 | */ |
72 | public function getId() : int |
73 | { |
74 | return $this->id; |
75 | } |
76 | |
77 | /** |
78 | * {@inheritdoc} |
79 | */ |
80 | public function toArray() : array |
81 | { |
82 | return [ |
83 | 'id' => $this->id, |
84 | ]; |
85 | } |
86 | |
87 | /** |
88 | * {@inheritdoc} |
89 | */ |
90 | public function jsonSerialize() : mixed |
91 | { |
92 | return $this->toArray(); |
93 | } |
94 | } |