| Total Complexity | 3 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Security_group_institution extends Model { |
||
| 8 | |||
| 9 | |||
| 10 | /** |
||
| 11 | * The database table used by the model. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $table = 'security_group_institutions'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Attributes that should be mass-assignable. |
||
| 19 | * |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | protected $fillable = ['security_group_id', 'institution_id', 'created_user_id', 'created']; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The attributes excluded from the model's JSON form. |
||
| 26 | * |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $hidden = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * The attributes that should be casted to native types. |
||
| 33 | * |
||
| 34 | * @var array |
||
| 35 | */ |
||
| 36 | protected $casts = []; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * The attributes that should be mutated to dates. |
||
| 40 | * |
||
| 41 | * @var array |
||
| 42 | */ |
||
| 43 | protected $dates = ['modified', 'created', 'created', 'created']; |
||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | public function institution(){ |
||
| 49 | } |
||
| 50 | |||
| 51 | public function institution_classes(){ |
||
| 52 | return $this->hasMany('App\Models\Institution_class','institution_id','institution_id') |
||
| 53 | ->select('institution_classes.*') |
||
| 54 | ->join('academic_periods', function($query){ |
||
| 55 | $query->on('institution_classes.academic_period_id','academic_periods.id'); |
||
| 56 | $query->whereIn('academic_periods.code',['2020','2019/2020']); |
||
| 57 | }); |
||
| 58 | } |
||
| 59 | |||
| 60 | public function security_group(){ |
||
| 62 | } |
||
| 63 | |||
| 64 | } |