You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
692 B

5 years ago
  1. <?php
  2. declare (strict_types=1);
  3. namespace App\Model;
  4. /**
  5. */
  6. class UserRelationBind extends Model
  7. {
  8. /**
  9. * The table associated with the model.
  10. *
  11. * @var string
  12. */
  13. protected $table = 'lanzu_user_relation_bind';
  14. /**
  15. * The attributes that are mass assignable.
  16. *
  17. * @var array
  18. */
  19. protected $fillable = ['bind_type', 'source_id', 'user_id', 'json_data'];
  20. /**
  21. * The attributes that should be cast to native types.
  22. *
  23. * @var array
  24. */
  25. protected $casts = [];
  26. public function setJsonDataAttribute($value)
  27. {
  28. $this->attributes['json_data'] = $value ? json_encode(json_decode($value, true)) : '';
  29. }
  30. }