| @@ -2,10 +2,29 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace FluentCommunity\App\Models; |
| 4 | 4 | |
| 5 | 5 | |
| 6 | +use FluentCommunity\App\Functions\Utility; | |
| 6 | 7 | use FluentCommunity\Framework\Support\Arr; |
| 7 | 8 | |
| 9 | +/** | |
| 10 | + * @property int $id | |
| 11 | + * @property int|null $created_by | |
| 12 | + * @property int|null $parent_id | |
| 13 | + * @property string $title | |
| 14 | + * @property string $slug | |
| 15 | + * @property string|null $description | |
| 16 | + * @property string|null $logo | |
| 17 | + * @property string|null $cover_photo | |
| 18 | + * @property string|null $type | |
| 19 | + * @property string|null $privacy | |
| 20 | + * @property string|null $status | |
| 21 | + * @property int|null $serial | |
| 22 | + * @property array $settings | |
| 23 | + * @property string|null $created_at | |
| 24 | + * @property string|null $updated_at | |
| 25 | + * @property-read mixed $spaces | |
| 26 | + */ | |
| 8 | 27 | class SpaceGroup extends Model |
| 9 | 28 | { |
| 10 | 29 | protected $table = 'fcom_spaces'; |
| 11 | 30 | |
| @@ -41,9 +60,9 @@ | ||
| 41 | 60 | $model->created_by = get_current_user_id(); |
| 42 | 61 | } |
| 43 | 62 | |
| 44 | 63 | if (empty($model->slug)) { |
| 45 | - $slug = sanitize_title($model->tilte, time()); | |
| 64 | + $slug = sanitize_title($model->title, (string) time()); | |
| 46 | 65 | $model->slug = $slug; |
| 47 | 66 | } |
| 48 | 67 | |
| 49 | 68 | $model->type = static::$type; |
| @@ -123,9 +142,9 @@ | ||
| 123 | 142 | } |
| 124 | 143 | |
| 125 | 144 | public function getSettingsAttribute($value) |
| 126 | 145 | { |
| 127 | - $settings = maybe_unserialize($value); | |
| 146 | + $settings = Utility::safeUnserialize($value); | |
| 128 | 147 | |
| 129 | 148 | if (!$settings) { |
| 130 | 149 | $settings = []; |
| 131 | 150 | } |