OriginatorTrait   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getOriginId() 0 4 1
A getOriginType() 0 4 1
A getOriginAlias() 0 4 1
A setOriginId() 0 6 1
A setOriginType() 0 10 2
A setOriginAlias() 0 6 1
1
<?php
2
3
namespace DoS\ResourceBundle\Model;
4
5
/**
6
 * @author liverbool <[email protected]>
7
 */
8
trait OriginatorTrait
9
{
10
    /**
11
     * @var int
12
     */
13
    protected $originId;
14
15
    /**
16
     * @var string
17
     */
18
    protected $originType;
19
20
    /**
21
     * @var string
22
     */
23
    protected $originAlias;
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function getOriginId()
29
    {
30
        return $this->originId;
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function setOriginId($originId)
37
    {
38
        $this->originId = $originId;
39
40
        return $this;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getOriginType()
47
    {
48
        return $this->originType;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function setOriginType($originType)
55
    {
56
        $this->originType = $originType;
57
58
        if (method_exists($originType, 'getOriginalAlias')) {
59
            $this->originAlias = $originType::getOriginalAlias();
60
        }
61
62
        return $this;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getOriginAlias()
69
    {
70
        return $this->originAlias;
71
    }
72
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function setOriginAlias($originAlias)
77
    {
78
        $this->originAlias = $originAlias;
79
80
        return $this;
81
    }
82
}
83