| Total Complexity | 4 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class User extends Model implements UserContract |
||
| 16 | { |
||
| 17 | use SoftDeletes, UserTrait { |
||
| 18 | setDataProviderId as baseSetDataProviderId; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Table to use |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | protected $table = 'control_users'; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Fillable attributes |
||
| 30 | * |
||
| 31 | * @var array |
||
| 32 | */ |
||
| 33 | protected $fillable = ['data_provider_id']; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Attributes to append when casting to an array |
||
| 37 | * |
||
| 38 | * @var array |
||
| 39 | */ |
||
| 40 | protected $appends = [ |
||
| 41 | 'data' |
||
| 42 | ]; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * ID of the user |
||
| 46 | * |
||
| 47 | * @return int |
||
| 48 | */ |
||
| 49 | 73 | public function id(): int |
|
| 50 | { |
||
| 51 | 73 | return $this->id; |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * ID of the data provider for the user |
||
| 56 | * |
||
| 57 | * @return int |
||
| 58 | */ |
||
| 59 | 21 | public function dataProviderId(): int |
|
| 60 | { |
||
| 61 | 21 | return $this->data_provider_id; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Laravel integration for a data property |
||
| 66 | * |
||
| 67 | * @return \BristolSU\ControlDB\Contracts\Models\DataUser |
||
| 68 | */ |
||
| 69 | 12 | public function getDataAttribute(): \BristolSU\ControlDB\Contracts\Models\DataUser |
|
| 72 | } |
||
| 73 | |||
| 74 | 2 | public function setDataProviderId(int $dataProviderId): void |
|
| 80 |