| 1 | <?php |
||
| 20 | trait NotificationTrait |
||
| 21 | { |
||
| 22 | |||
| 23 | public $rangeAttribute = 'range'; |
||
| 24 | public $linkAttrbute = ''; |
||
| 25 | public $expiredAt = 10080; // in minutes. |
||
| 26 | |||
| 27 | public function getIsExpired() |
||
| 31 | |||
| 32 | public function removeExpired() |
||
| 38 | |||
| 39 | public function onRemoveExpired($event) |
||
| 44 | |||
| 45 | public function initNotificationEvents() |
||
| 49 | } |
||
| 50 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: