Total Complexity | 7 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
12 | class Consumption extends \hipanel\base\Model |
||
13 | { |
||
14 | use \hipanel\base\ModelTrait; |
||
15 | |||
16 | public function rules() |
||
17 | { |
||
18 | return [ |
||
19 | [['id', 'object_id'], 'integer'], |
||
20 | [['value', 'overuse'], 'safe'], |
||
21 | [['type', 'limit', 'time', 'unit', 'action_unit', 'currency'], 'string'], |
||
22 | [['price'], 'number'], |
||
23 | ]; |
||
24 | } |
||
25 | |||
26 | public function getCurrentValue(): ?string |
||
27 | { |
||
28 | return $this->value[$this->getCurrent()]; |
||
29 | } |
||
30 | |||
31 | public function getCurrentOveruse(): ?string |
||
34 | } |
||
35 | |||
36 | public function getPreviousValue(): ?string |
||
37 | { |
||
38 | return $this->value[$this->getPrevious()]; |
||
39 | } |
||
40 | |||
41 | public function getPreviousOveruse(): ?string |
||
44 | } |
||
45 | |||
46 | private function getCurrent(): string |
||
49 | } |
||
50 | |||
51 | private function getPrevious(): string |
||
54 | } |
||
55 | } |
||
56 |