Academic_period   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 39
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAcademicPeriod() 0 2 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Academic_period extends Base_Model  {
8
9
    /**
10
     * The database table used by the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'academic_periods';
15
16
    /**
17
     * Attributes that should be mass-assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = ['code', 'name', 'start_date', 'start_year', 'end_date', 'end_year', 'school_days', 'current', 'editable', 'parent_id', 'lft', 'rght', 'academic_period_level_id', 'order', 'visible', 'modified_user_id', 'modified', 'created_user_id', 'created'];
22
23
    /**
24
     * The attributes excluded from the model's JSON form.
25
     *
26
     * @var array
27
     */
28
    protected $hidden = [];
29
30
    /**
31
     * The attributes that should be casted to native types.
32
     *
33
     * @var array
34
     */
35
    protected $casts = [];
36
37
    /**
38
     * The attributes that should be mutated to dates.
39
     *
40
     * @var array
41
     */
42
    protected $dates = ['start_date', 'end_date', 'modified', 'created'];
43
44
    public function getAcademicPeriod($year){
45
        return self::query()->where('code',$year)->first();
46
    }
47
48
}
49