ConfigStatus   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 49
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A users() 0 4 1
A status() 0 4 1
A issue() 0 4 1
1
<?php
2
/**
3
 * GitScrum v0.1.
4
 *
5
 * @author  Renato Marinho <[email protected]>
6
 * @license http://opensource.org/licenses/GPL-3.0 GPLv3
7
 */
8
9
namespace GitScrum\Models;
10
11
use GitScrum\Scopes\ConfigStatusScope;
12
use Illuminate\Database\Eloquent\Model;
13
14
class ConfigStatus extends Model
15
{
16
    use ConfigStatusScope;
17
18
    /**
19
     * The database table used by the model.
20
     *
21
     * @var string
22
     */
23
    protected $table = 'config_statuses';
24
25
    /**
26
     * Attributes that should be mass-assignable.
27
     *
28
     * @var array
29
     */
30
    protected $fillable = ['type', 'name', 'description', 'position'];
31
32
    /**
33
     * The attributes excluded from the model's JSON form.
34
     *
35
     * @var array
36
     */
37
    protected $hidden = [];
38
39
    /**
40
     * The attributes that should be casted to native types.
41
     *
42
     * @var array
43
     */
44
    protected $casts = [];
45
46
    public $timestamps = false;
47
48
    public function users()
49
    {
50
        return $this->belongsToMany(\GitScrum\Models\User::class, 'statuses', 'id', 'user_id');
51
    }
52
53
    public function status()
54
    {
55
        //return $this->hasOne(\GitScrum\Models\Status::class, 'id', 'id');
56
    }
57
58
    public function issue()
59
    {
60
        return $this->belongsTo(\GitScrum\Models\Issue::class, 'config_status_id', 'id');
61
    }
62
}
63