Transition   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A flow() 0 4 1
A from() 0 4 1
A to() 0 4 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Flows;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Transition
9
 * @package Modules\Flows\Entities
10
 */
11
class Transition extends Model
12
{
13
    /**
14
     * @var string
15
     */
16
    public $table = "fl_flows_steps_transitions";
17
18
    /**
19
     * @var array
20
     */
21
    public $fillable = ['flow_id', 'step_from_id', 'step_to_id'];
22
23
    /**
24
     * The flow this transition belongs to
25
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
26
     */
27
    public function flow()
28
    {
29
        return $this->belongsTo(Flow::class);
30
    }
31
32
    /**
33
     * The step this transition comes from
34
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
35
     */
36
    public function from()
37
    {
38
        return $this->belongsTo(Step::class, 'step_from_id');
39
    }
40
41
    /**
42
     * The step this transition goes to
43
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
44
     */
45
    public function to()
46
    {
47
        return $this->belongsTo(Step::class, 'step_to_id');
48
    }
49
}
50