BoardPoll   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A answers() 0 4 1
A thread() 0 4 1
A user() 0 4 1
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Models;
9
10
use Illuminate\Database\Eloquent\Model;
11
12
/**
13
 * Class BoardPoll.
14
 *
15
 * @property int $id
16
 * @property string $title
17
 * @property int $user_id
18
 * @property \Carbon\Carbon $created_at
19
 * @property \Carbon\Carbon $updated_at
20
 * @property int $thread_id
21
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BoardPollAnswer[] $answers
22
 * @property-read \App\Models\BoardThread $thread
23
 * @property-read \App\Models\User $user
24
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPoll whereCreatedAt($value)
25
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPoll whereId($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPoll whereThreadId($value)
27
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPoll whereTitle($value)
28
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPoll whereUpdatedAt($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPoll whereUserId($value)
30
 * @mixin \Eloquent
31
 */
32
class BoardPoll extends Model
33
{
34
    protected $table = 'board_poll';
35
36
    public $timestamps = true;
37
38
    protected $fillable = [
39
        'title',
40
        'thread_id',
41
        'user_id',
42
    ];
43
44
    protected $guarded = [];
45
46
    public function answers()
47
    {
48
        return $this->hasMany('App\Models\BoardPollAnswer', 'id', 'poll_id');
49
    }
50
51
    public function thread()
52
    {
53
        return $this->hasOne('App\Models\BoardThread', 'id', 'thread_id');
54
    }
55
56
    public function user()
57
    {
58
        return $this->hasOne('App\Models\User', 'id', 'user_id');
59
    }
60
}
61