Passed
Push — task/experience-models ( f8cac9...6cc85a )
by Grant
17:57
created

ExperienceCommunity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 17
c 1
b 0
f 1
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A community_experienceable() 0 3 1
A job_applications() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use App\Models\BaseModel;
6
7
/**
8
 * Class ExperienceCommunity
9
 *
10
 * @property int $id
11
 * @property string $title
12
 * @property string $group
13
 * @property string $project
14
 * @property boolean $is_active
15
 * @property \Jenssegers\Date\Date $start_date
16
 * @property \Jenssegers\Date\Date $end_date
17
 * @property int $community_experienceable_id
18
 * @property string $community_experienceable_type
19
 * @property \Jenssegers\Date\Date $created_at
20
 * @property \Jenssegers\Date\Date $updated_at
21
 *
22
 * @property \Illuminate\Database\Eloquent\Collection $job_applications
23
 * @property \App\Models\Applicant|\App\Models\JobApplication $community_experienceable
24
 */
25
class ExperienceCommunity extends BaseModel
26
{
27
    protected $casts = [
28
        'title' => 'string',
29
        'group' => 'string',
30
        'project' => 'string',
31
        'is_active' => 'boolean',
32
        'start_date' => 'date',
33
        'end_date' => 'date'
34
    ];
35
36
    protected $fillable = [
37
        'title',
38
        'group',
39
        'project',
40
        'is_active',
41
        'start_date',
42
        'end_date'
43
    ];
44
45
    public function job_applications() //phpcs:ignore
46
    {
47
        return $this->belongsToMany(\App\Models\JobApplication::class);
48
    }
49
50
    public function community_experienceable() //phpcs:ignore
51
    {
52
        return $this->morphTo();
53
    }
54
}
55