History   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getApiKeys() 0 4 1
A getWorkflow() 0 4 1
A getStateFrom() 0 4 1
A getStateTo() 0 4 1
A getUserName() 0 4 1
1
<?php
2
3
namespace Jawaraegov\Workflows\Models;
4
5
use Illuminate\Notifications\Notifiable;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\SoftDeletes;
8
9
class History extends Model
10
{
11
    use Notifiable;
12
13
    protected $table = 'historys';
14
    public $timestamps = true;
15
16
    use SoftDeletes;
17
18
    protected $dates = ['deleted_at'];
19
    protected $fillable = array('content_id', 'workflow_id', 'from_state', 'to_state', 'user_id');
20
21
    public function getApiKeys()
22
    {
23
        return $this->belongsTo('App\ApiKeys', 'content_id', 'id');
24
    }
25
26
    public function getWorkflow()
27
    {
28
        return $this->belongsTo('Jawaraegov\Workflows\Models\WorkflowModel', 'workflow_id', 'id');
29
    }
30
31
    public function getStateFrom()
32
    {
33
        return $this->belongsTo('Jawaraegov\Workflows\Models\WorkflowState', 'from_state', 'id');
34
    }
35
36
    public function getStateTo()
37
    {
38
        return $this->belongsTo('Jawaraegov\Workflows\Models\WorkflowState', 'to_state', 'id');
39
    }
40
41
    public function getUserName()
42
    {
43
        return $this->belongsTo('App\User','user_id','id');
44
    }
45
46
}
47