Reply::getPresenterClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PHPHub;
4
5
use McCool\LaravelAutoPresenter\HasPresenter;
6
use PHPHub\Presenters\ReplyPresenter;
7
use Illuminate\Database\Eloquent\Model;
8
9
class Reply extends Model implements HasPresenter
10
{
11
    public static $includable = ['id', 'body', 'body_original', 'vote_count'];
12
    protected $fillable = ['body', 'topic_id'];
13
14
    protected $casts = [
15
        'user_id'    => 'int',
16
        'topic_id'   => 'int',
17
        'is_block'   => 'boolean',
18
        'vote_count' => 'int',
19
    ];
20
21
    public function topic()
22
    {
23
        return $this->belongsTo(Topic::class);
24
    }
25
26
    public function user()
27
    {
28
        return $this->belongsTo(User::class);
29
    }
30
31
    /**
32
     * Get the presenter class.
33
     *
34
     * @return string
35
     */
36
    public function getPresenterClass()
37
    {
38
        return ReplyPresenter::class;
39
    }
40
}
41