| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FluentCommunity\App\Models; |
| 4 | 4 | |
| 5 | +use FluentCommunity\App\Functions\Utility; | |
| 5 | 6 | use FluentCommunity\App\Models\XProfile; |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * Meta Model - DB Model for Notifications table |
| @@ -11,8 +12,17 @@ | ||
| 11 | 12 | * |
| 12 | 13 | * @package FluentCommunity\App\Models |
| 13 | 14 | * |
| 14 | 15 | * @version 1.0.0 |
| 16 | + * | |
| 17 | + * @property int $id | |
| 18 | + * @property int|null $feed_id | |
| 19 | + * @property int|null $object_id | |
| 20 | + * @property int|null $src_user_id | |
| 21 | + * @property string|null $src_object_type | |
| 22 | + * @property string|null $action | |
| 23 | + * @property mixed $route | |
| 24 | + * @property string|null $content | |
| 15 | 25 | */ |
| 16 | 26 | class Notification extends Model |
| 17 | 27 | { |
| 18 | 28 | protected $table = 'fcom_notifications'; |
| @@ -47,9 +57,9 @@ | ||
| 47 | 57 | } |
| 48 | 58 | |
| 49 | 59 | public function getRouteAttribute($value) |
| 50 | 60 | { |
| 51 | - return maybe_unserialize($value); | |
| 61 | + return Utility::safeUnserialize($value); | |
| 52 | 62 | } |
| 53 | 63 | |
| 54 | 64 | public function subscribers() |
| 55 | 65 | { |
| @@ -108,9 +118,8 @@ | ||
| 108 | 118 | } |
| 109 | 119 | |
| 110 | 120 | public function scopeByStatus($query, $status, $userId) |
| 111 | 121 | { |
| 112 | - | |
| 113 | 122 | $valids = ['unread', 'read']; |
| 114 | 123 | if (!in_array($status, $valids)) { |
| 115 | 124 | return $query; |
| 116 | 125 | } |