Completed
Push — master ( 533f80...ba63a0 )
by Ricardo
04:00
created

Transaction::workflow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Fabrica\Models\Workflow;
4
5
use Pedreiro\Models\Base;
6
7
class Transaction extends Base
8
{
9
10
    protected $organizationPerspective = false;
11
12
    protected $table = 'workflow_transactions';       
13
14
    /**
15
     * The attributes that are mass assignable.
16
     *
17
     * @var array
18
     */
19
    protected $fillable = [
20
        'name',
21
        'workflow_id',
22
        'stage_from_id',
23
        'stage_to_id',
24
    ];
25
26
27
    protected $mappingProperties = array(
28
29
        'workflow_id' => [
30
            'type' => 'string',
31
            "analyzer" => "standard",
32
        ],
33
        'stage_from_id' => [
34
            'type' => 'string',
35
            "analyzer" => "standard",
36
        ],
37
        'stage_to_id' => [
38
            'type' => 'string',
39
            "analyzer" => "standard",
40
        ],
41
    );
42
43
44
    public function workflow()
45
    {
46
        return $this->belongsTo('Fabrica\Models\Workflow\Workflow', 'table_id', 'id');
47
    }
48
49
    public function stageFrom()
50
    {
51
        return $this->belongsTo('Fabrica\Models\Code\Stage', 'table_id', 'id');
52
    }
53
54
    public function stageTo()
55
    {
56
        return $this->belongsTo('Fabrica\Models\Code\Stage', 'table_id', 'id');
57
    }
58
}