@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Special_need_difficulty extends Model { |
|
7 | +class Special_need_difficulty extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,7 +42,7 @@ |
||
42 | 42 | protected $dates = ['modified', 'created']; |
43 | 43 | |
44 | 44 | public function shiftExists($shift){ |
45 | - return self::query() |
|
45 | + return self::query() |
|
46 | 46 | ->where('institution_id',$shift['institution_id']) |
47 | 47 | ->where('location_institution_id',$shift['location_institution_id']) |
48 | 48 | ->where('shift_option_id',$shift['shift_option_id']) |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Institution_shift extends Base_Model { |
|
7 | +class Institution_shift extends Base_Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -41,29 +41,29 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected $dates = ['modified', 'created']; |
43 | 43 | |
44 | - public function shiftExists($shift){ |
|
44 | + public function shiftExists($shift) { |
|
45 | 45 | return self::query() |
46 | - ->where('institution_id',$shift['institution_id']) |
|
47 | - ->where('location_institution_id',$shift['location_institution_id']) |
|
48 | - ->where('shift_option_id',$shift['shift_option_id']) |
|
49 | - ->where('academic_period_id',$shift['academic_period_id'])->exists(); |
|
46 | + ->where('institution_id', $shift['institution_id']) |
|
47 | + ->where('location_institution_id', $shift['location_institution_id']) |
|
48 | + ->where('shift_option_id', $shift['shift_option_id']) |
|
49 | + ->where('academic_period_id', $shift['academic_period_id'])->exists(); |
|
50 | 50 | } |
51 | 51 | |
52 | - public function getShiftsToClone(int $year){ |
|
52 | + public function getShiftsToClone(int $year) { |
|
53 | 53 | return self::query() |
54 | 54 | ->select('institution_shifts.*') |
55 | - ->join('academic_periods','academic_periods.id','=','institution_shifts.academic_period_id') |
|
55 | + ->join('academic_periods', 'academic_periods.id', '=', 'institution_shifts.academic_period_id') |
|
56 | 56 | // ->where('academic_periods.code',$year) |
57 | - ->where('institution_shifts.cloned',$year) |
|
57 | + ->where('institution_shifts.cloned', $year) |
|
58 | 58 | ->get()->toArray(); |
59 | 59 | } |
60 | 60 | |
61 | - public function getShiftsTodelete(int $year,$academic_period_id){ |
|
61 | + public function getShiftsTodelete(int $year, $academic_period_id) { |
|
62 | 62 | return self::query() |
63 | 63 | ->select('institution_shifts.*') |
64 | - ->join('academic_periods','academic_periods.id','=','institution_shifts.academic_period_id') |
|
65 | - ->where('academic_period_id',$academic_period_id) |
|
66 | - ->where('institution_shifts.cloned',$year) |
|
64 | + ->join('academic_periods', 'academic_periods.id', '=', 'institution_shifts.academic_period_id') |
|
65 | + ->where('academic_period_id', $academic_period_id) |
|
66 | + ->where('institution_shifts.cloned', $year) |
|
67 | 67 | ->get()->toArray(); |
68 | 68 | } |
69 | 69 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Security_role extends Model { |
|
7 | +class Security_role extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | protected $dates = ['modified', 'created']; |
43 | 43 | |
44 | 44 | |
45 | - public function securityUsers(){ |
|
46 | - return $this->belongsToMany(Security_group_user::class,'security_group_users','security_group_id','security_group_id'); |
|
45 | + public function securityUsers() { |
|
46 | + return $this->belongsToMany(Security_group_user::class, 'security_group_users', 'security_group_id', 'security_group_id'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | use Webpatser\Uuid\Uuid; |
7 | 7 | |
8 | -class User_identity extends Model { |
|
8 | +class User_identity extends Model { |
|
9 | 9 | |
10 | 10 | public const CREATED_AT = 'created'; |
11 | 11 | public const UPDATED_AT = 'modified'; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Institution_subjects_room extends Model { |
|
7 | +class Institution_subjects_room extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,11 +42,11 @@ |
||
42 | 42 | protected $dates = ['special_need_date', 'modified', 'created']; |
43 | 43 | |
44 | 44 | |
45 | - public static function isDuplicated($inputs){ |
|
45 | + public static function isDuplicated($inputs){ |
|
46 | 46 | |
47 | - $exists = self::where('security_user_id','=',$inputs['security_user_id']) |
|
48 | - ->where('special_need_type_id','=',$inputs['special_need_type_id']) |
|
49 | - ->where('special_need_difficulty_id','=',$inputs['special_need_difficulty_id'])->count(); |
|
47 | + $exists = self::where('security_user_id','=',$inputs['security_user_id']) |
|
48 | + ->where('special_need_type_id','=',$inputs['special_need_type_id']) |
|
49 | + ->where('special_need_difficulty_id','=',$inputs['special_need_difficulty_id'])->count(); |
|
50 | 50 | |
51 | 51 | // dd($exists); |
52 | 52 | return $exists == 0 ? true :false; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class User_special_need extends Base_Model { |
|
7 | +class User_special_need extends Base_Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | protected $dates = ['special_need_date', 'modified', 'created']; |
43 | 43 | |
44 | 44 | |
45 | - public static function isDuplicated($inputs){ |
|
45 | + public static function isDuplicated($inputs) { |
|
46 | 46 | |
47 | - $exists = self::where('security_user_id','=',$inputs['security_user_id']) |
|
48 | - ->where('special_need_type_id','=',$inputs['special_need_type_id']) |
|
49 | - ->where('special_need_difficulty_id','=',$inputs['special_need_difficulty_id'])->count(); |
|
47 | + $exists = self::where('security_user_id', '=', $inputs['security_user_id']) |
|
48 | + ->where('special_need_type_id', '=', $inputs['special_need_type_id']) |
|
49 | + ->where('special_need_difficulty_id', '=', $inputs['special_need_difficulty_id'])->count(); |
|
50 | 50 | |
51 | 51 | // dd($exists); |
52 | 52 | return $exists == 0 ? true :false; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Security_group_user extends Model { |
|
7 | +class Security_group_user extends Model { |
|
8 | 8 | |
9 | 9 | public const CREATED_AT = 'created'; |
10 | 10 | public const UPDATED_AT = 'modified'; |
@@ -45,34 +45,34 @@ discard block |
||
45 | 45 | protected $dates = ['modified', 'created', 'created']; |
46 | 46 | |
47 | 47 | |
48 | - public function security_user(){ |
|
49 | - return $this->belongsToMany('App\Models\User','security_users'); |
|
48 | + public function security_user() { |
|
49 | + return $this->belongsToMany('App\Models\User', 'security_users'); |
|
50 | 50 | } |
51 | 51 | |
52 | - public function security_group(){ |
|
53 | - return $this->hasMany('App\Models\Security_group' , 'id','security_group_id'); |
|
52 | + public function security_group() { |
|
53 | + return $this->hasMany('App\Models\Security_group', 'id', 'security_group_id'); |
|
54 | 54 | } |
55 | 55 | |
56 | - public function security_group_institution(){ |
|
57 | - return $this->belongsTo('App\Models\Security_group_institution','security_group_id','security_group_id'); |
|
56 | + public function security_group_institution() { |
|
57 | + return $this->belongsTo('App\Models\Security_group_institution', 'security_group_id', 'security_group_id'); |
|
58 | 58 | } |
59 | 59 | |
60 | - public function staff_class(){ |
|
61 | - return $this->hasMany('App\Models\Institution_class','staff_id','security_user_id'); |
|
60 | + public function staff_class() { |
|
61 | + return $this->hasMany('App\Models\Institution_class', 'staff_id', 'security_user_id'); |
|
62 | 62 | } |
63 | 63 | |
64 | - public function institution_staff(){ |
|
65 | - return $this->belongsTo('App\Models\Institution_staff','security_user_id','staff_id'); |
|
64 | + public function institution_staff() { |
|
65 | + return $this->belongsTo('App\Models\Institution_staff', 'security_user_id', 'staff_id'); |
|
66 | 66 | } |
67 | 67 | |
68 | - public function institution_group(){ |
|
69 | - return $this->hasMany('App\Models\Security_group_institution','security_group_id','security_group_id') |
|
70 | - ->with(['institution','institution_classes']); |
|
68 | + public function institution_group() { |
|
69 | + return $this->hasMany('App\Models\Security_group_institution', 'security_group_id', 'security_group_id') |
|
70 | + ->with(['institution', 'institution_classes']); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | - public function roles(){ |
|
75 | - return $this->belongsTo('App\Models\Security_role','security_role_id','id'); |
|
74 | + public function roles() { |
|
75 | + return $this->belongsTo('App\Models\Security_role', 'security_role_id', 'id'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Institution_subject extends Base_Model { |
|
7 | +class Institution_subject extends Base_Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,28 +42,28 @@ discard block |
||
42 | 42 | protected $dates = ['modified', 'created', 'modified', 'created']; |
43 | 43 | |
44 | 44 | |
45 | - public function institutionGradeSubject(){ |
|
46 | - return $this->belongsTo('App\Models\Education_grades_subject','education_subject_id','education_subject_id'); |
|
45 | + public function institutionGradeSubject() { |
|
46 | + return $this->belongsTo('App\Models\Education_grades_subject', 'education_subject_id', 'education_subject_id'); |
|
47 | 47 | } |
48 | 48 | |
49 | - public function institutionOptionalGradeSubject(){ |
|
50 | - return $this->belongsTo('App\Models\Education_grades_subject','education_grade_id','education_grade_id'); |
|
49 | + public function institutionOptionalGradeSubject() { |
|
50 | + return $this->belongsTo('App\Models\Education_grades_subject', 'education_grade_id', 'education_grade_id'); |
|
51 | 51 | } |
52 | 52 | |
53 | - public function institutionMandatoryGradeSubject(){ |
|
54 | - return $this->belongsTo('App\Models\Education_grades_subject','education_grade_id','education_grade_id'); |
|
53 | + public function institutionMandatoryGradeSubject() { |
|
54 | + return $this->belongsTo('App\Models\Education_grades_subject', 'education_grade_id', 'education_grade_id'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | - public function institutionClassSubject(){ |
|
59 | - return $this->hasMany('App\Models\Institution_class_subject','institution_class_id','id'); |
|
58 | + public function institutionClassSubject() { |
|
59 | + return $this->hasMany('App\Models\Institution_class_subject', 'institution_class_id', 'id'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | - public function getInstitutionSubjects($institution_id,$academic_period_id){ |
|
65 | - return self::query()->where('institution_id',$institution_id) |
|
66 | - ->where('academic_period_id',$academic_period_id) |
|
64 | + public function getInstitutionSubjects($institution_id, $academic_period_id) { |
|
65 | + return self::query()->where('institution_id', $institution_id) |
|
66 | + ->where('academic_period_id', $academic_period_id) |
|
67 | 67 | ->get()->toArray(); |
68 | 68 | } |
69 | 69 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Security_group extends Model { |
|
7 | +class Security_group extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | // return $this->hasMany( User::class); |
46 | 46 | // } |
47 | 47 | |
48 | - public function security_users(){ |
|
49 | - return $this->belongsTo('App\Models\Security_group_user','security_group_id'); |
|
48 | + public function security_users() { |
|
49 | + return $this->belongsTo('App\Models\Security_group_user', 'security_group_id'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | - public function security_group_institution(){ |
|
54 | - return $this->hasMany('App\Models\Security_group_institution','security_group_id'); |
|
53 | + public function security_group_institution() { |
|
54 | + return $this->hasMany('App\Models\Security_group_institution', 'security_group_id'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |
58 | 58 | \ No newline at end of file |