| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | trait HasDraftedFlagHelpers |
||
| 17 | { |
||
| 18 | public function initializeHasDraftedFlagHelpers(): void |
||
| 21 | } |
||
| 22 | |||
| 23 | public function isDrafted(): bool |
||
| 24 | { |
||
| 25 | return $this->getAttributeValue('is_drafted'); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function isNotDrafted(): bool |
||
| 29 | { |
||
| 30 | return !$this->isDrafted(); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function draft(): void |
||
| 34 | { |
||
| 35 | $this->setAttribute('is_drafted', true); |
||
| 36 | $this->save(); |
||
| 37 | |||
| 38 | $this->fireModelEvent('drafted', false); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function undraft(): void |
||
| 47 | } |
||
| 48 | } |
||
| 49 |