| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | trait HasClosedAtHelpers |
||
| 19 | { |
||
| 20 | public function initializeHasClosedAtHelpers(): void |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * If entity is closed. |
||
| 27 | * |
||
| 28 | * @return bool |
||
| 29 | */ |
||
| 30 | public function isClosed(): bool |
||
| 31 | { |
||
| 32 | return !is_null($this->getAttributeValue('closed_at')); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * If entity is opened. |
||
| 37 | * |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | public function isOpened(): bool |
||
| 41 | { |
||
| 42 | return !$this->isClosed(); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Mark entity as closed. |
||
| 47 | * |
||
| 48 | * @return void |
||
| 49 | */ |
||
| 50 | public function close(): void |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Mark entity as opened. |
||
| 60 | * |
||
| 61 | * @return void |
||
| 62 | */ |
||
| 63 | public function open(): void |
||
| 71 |