| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentBoards\App\Models; |
| 4 |
|
| 5 |
use FluentBoards\Framework\Database\Orm\Relations\BelongsTo; |
| 6 |
|
| 7 |
class Team extends Model |
| 8 |
{ |
| 9 |
protected $table = 'fbs_teams'; |
| 10 |
|
| 11 |
protected $guarded = ['id']; |
| 12 |
|
| 13 |
public function setSettingsAttribute($settings) |
| 14 |
{ |
| 15 |
$this->attributes['settings'] = \maybe_serialize($settings); |
| 16 |
} |
| 17 |
|
| 18 |
public function getSettingsAttribute($settings) |
| 19 |
{ |
| 20 |
return \maybe_unserialize($settings); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* @return BelongsTo |
| 25 |
*/ |
| 26 |
public function parent() |
| 27 |
{ |
| 28 |
return $this->belongsTo(Team::class, 'parent_id'); |
| 29 |
} |
| 30 |
} |