Passed
Push — dependabot/npm_and_yarn/dev/st... ( 790070...2dbd00 )
by
unknown
17:44 queued 12:22
created

Comment::job_poster()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Comment
9
 *
10
 * @property int $id
11
 * @property int $job_poster_id
12
 * @property int $user_id
13
 * @property string $comment
14
 * @property string $location
15
 * @property \App\Models\Lookup\CommentType $type_id
16
 * @property \Jenssegers\Date\Date $created_at
17
 * @property \Jenssegers\Date\Date $updated_at
18
 *
19
 * @property \App\Models\JobPoster $job_poster
20
 * @property \App\Models\User $user
21
 * @property \App\Models\Lookup\CommentType $comment_type
22
 */
23
24
class Comment extends Model
25
{
26
    /**
27
     * The attributes that are mass assignable.
28
     *
29
     * @var array
30
     */
31
    protected $fillable = ['comment', 'location', 'type_id'];
32
33
    public function job_poster() // phpcs:ignore
34
    {
35
        return $this->belongsTo(\App\Models\JobPoster::class);
36
    }
37
38
    public function user() // phpcs:ignore
39
    {
40
        return $this->belongsTo(\App\Models\User::class);
41
    }
42
43
    public function comment_type() // phpcs:ignore
44
    {
45
        return $this->belongsTo(\App\Models\Lookup\CommentType::class, 'type_id');
46
    }
47
}
48