| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class CustomerSystems extends Model |
||
| 9 | { |
||
| 10 | use SoftDeletes; |
||
| 11 | |||
| 12 | protected $primaryKey = 'cust_sys_id'; |
||
| 13 | protected $fillable = ['cust_id', 'sys_id', 'shared']; |
||
| 14 | protected $hidden = ['created_at', 'updated_at', 'deleted_at', 'SystemTypes']; |
||
| 15 | protected $appends = ['sys_name']; |
||
| 16 | |||
| 17 | 8 | public function SystemTypes() |
|
| 20 | } |
||
| 21 | |||
| 22 | 4 | public function CustomerSystemData() |
|
| 23 | { |
||
| 24 | 4 | return $this->hasMany('App\CustomerSystemData', 'cust_sys_id'); |
|
| 25 | } |
||
| 26 | |||
| 27 | public function SystemDataFields() |
||
| 28 | { |
||
| 29 | return $this->belongsToMany('App\SystemDataFields', 'customer_system_data', 'cust_sys_id', 'field_id')->withPivot('value')->orderBy('order', 'ASC'); |
||
| 30 | } |
||
| 31 | |||
| 32 | 8 | public function getSysNameAttribute() |
|
| 35 | } |
||
| 36 | } |
||
| 37 |