Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | trait HasEndedAtHelpers |
||
19 | { |
||
20 | public function initializeHasEndedAtHelpers(): void |
||
23 | } |
||
24 | |||
25 | public function isEnded(): bool |
||
26 | { |
||
27 | return !is_null($this->getAttributeValue('ended_at')); |
||
28 | } |
||
29 | |||
30 | public function isNotEnded(): bool |
||
33 | } |
||
34 | |||
35 | public function end(): void |
||
36 | { |
||
37 | $this->setAttribute('ended_at', Date::now()); |
||
38 | $this->save(); |
||
39 | |||
40 | $this->fireModelEvent('ended', false); |
||
41 | } |
||
42 | |||
43 | public function undoEnd(): void |
||
49 | } |
||
50 | } |
||
51 |