Total Complexity | 7 |
Total Lines | 73 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | trait HasAcceptedFlagHelpers |
||
17 | { |
||
18 | public function initializeHasAcceptedFlagHelpers(): void |
||
19 | { |
||
20 | $this->casts['is_accepted'] = 'boolean'; |
||
|
|||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Set accepted flag. |
||
25 | * |
||
26 | * @return static |
||
27 | */ |
||
28 | public function setAcceptedFlag() |
||
29 | { |
||
30 | $this->setAttribute('is_accepted', true); |
||
31 | |||
32 | return $this; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Unset accepted flag. |
||
37 | * |
||
38 | * @return static |
||
39 | */ |
||
40 | public function unsetAcceptedFlag() |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * If entity is accepted. |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function isAccepted(): bool |
||
53 | { |
||
54 | return $this->getAttributeValue('is_accepted'); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * If entity is rejected. |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function isRejected(): bool |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Mark entity as accepted. |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public function accept(): void |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * Mark entity as rejected. |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | public function reject(): void |
||
89 | } |
||
90 | } |
||
91 |