Passed
Push — master ( e7fb25...290b3a )
by Mohamed
10:38
created

Institution   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isActive() 0 2 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Institution extends Model
8
{
9
     /**
10
     * The database table used by the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'institutions';
15
16
    /**
17
     * Attributes that should be mass-assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = ['name', 'alternative_name', 'code', 'address', 'postal_code', 'contact_person', 'telephone', 'fax', 'email', 'website', 'date_opened', 'year_opened', 'date_closed', 'year_closed', 'longitude', 'latitude', 'logo_name', 'logo_content', 'shift_type', 'classification', 'area_id', 'area_administrative_id', 'institution_locality_id', 'institution_type_id', 'institution_ownership_id', 'institution_status_id', 'institution_sector_id', 'institution_provider_id', 'institution_gender_id', 'security_group_id', '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 = ['date_opened', 'date_closed', 'modified', 'created'];
43
44
    public function isActive($id){
45
       return  self::query()->find($id)->get()->first()->institution_status_id == 1;
46
    }
47
}
48