Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
18 | trait HasArchivedAtHelpers |
||
19 | { |
||
20 | public function initializeHasArchivedAtHelpers(): void |
||
23 | } |
||
24 | |||
25 | public function isArchived(): bool |
||
26 | { |
||
27 | return !is_null($this->getAttributeValue('archived_at')); |
||
28 | } |
||
29 | |||
30 | public function isNotArchived(): bool |
||
33 | } |
||
34 | |||
35 | public function archive(): void |
||
36 | { |
||
37 | $this->setAttribute('archived_at', Date::now()); |
||
38 | $this->save(); |
||
39 | |||
40 | $this->fireModelEvent('archived', false); |
||
41 | } |
||
42 | |||
43 | public function unarchive(): void |
||
49 | } |
||
50 | } |
||
51 |