Action::getDevice()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity()
9
 * @ORM\Table(name="actions")
10
 */
11
class Action
12
{
13
    /**
14
     * @ORM\Column(type="integer")
15
     * @ORM\Id
16
     * @ORM\GeneratedValue(strategy="AUTO")
17
     */
18
    private $id;
19
20
    /**
21
     * @ORM\Column(type="string", length=100)
22
     */
23
    private $name;
24
25
    /**
26
     * @ORM\Column(type="string", length=100)
27
     */
28
    private $alias;
29
30
    /**
31
     * @return mixed
32
     */
33
    public function getAlias()
34
    {
35
        return $this->alias;
36
    }
37
38
    /**
39
     * @param mixed $alias
40
     * @return Action
41
     */
42 1
    public function setAlias($alias)
43
    {
44 1
        $this->alias = $alias;
45 1
        return $this;
46
    }
47
48
    /**
49
     * @ORM\Column(type="string", length=100)
50
     */
51
    private $executor;
52
53
    /**
54
     * @ORM\Column(type="text")
55
     */
56
    private $arguments;
57
58
    /**
59
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Device", inversedBy="actions")
60
     */
61
    private $device;
62
63
    /**
64
     * @ORM\Column(type="string", length=100)
65
     */
66
    private $type;
67
68
69
    /**
70
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\ActionHistory", mappedBy="action")
71
     */
72
    public $history;
73
74
    /**
75
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\Trigger", mappedBy="onActivate")
76
     */
77
    public $activateTriggers;
78
79
    /**
80
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\Trigger", mappedBy="onDeactivate")
81
     */
82
    public $deactivateTriggers;
83
84
85
    /**
86
     * @return mixed
87
     */
88
    public function getType()
89
    {
90
        return $this->type;
91
    }
92
93
    /**
94
     * @param mixed $type
95
     * @return Action
96
     */
97 1
    public function setType($type)
98
    {
99 1
        $this->type = $type;
100 1
        return $this;
101
    }
102
103
    /**
104
     * @return Device
105
     */
106 1
    public function getDevice()
107
    {
108 1
        return $this->device;
109
    }
110
111
    /**
112
     * @param mixed $device
113
     * @return Action
114
     */
115 1
    public function setDevice($device)
116
    {
117 1
        $this->device = $device;
118 1
        return $this;
119
    }
120
121
    /**
122
     * @return mixed
123
     */
124 1
    public function getArguments()
125
    {
126 1
        return $this->arguments;
127
    }
128
129
    /**
130
     * @param mixed $arguments
131
     * @return Action
132
     */
133 1
    public function setArguments($arguments)
134
    {
135 1
        $this->arguments = $arguments;
136 1
        return $this;
137
    }
138
139
140
    /**
141
     * @return mixed
142
     */
143
    public function getId()
144
    {
145
        return $this->id;
146
    }
147
148
    /**
149
     * @param mixed $id
150
     * @return Action
151
     */
152
    public function setId($id)
153
    {
154
        $this->id = $id;
155
        return $this;
156
    }
157
158
    /**
159
     * @return mixed
160
     */
161
    public function getName()
162
    {
163
        return $this->name;
164
    }
165
166
    /**
167
     * @param mixed $name
168
     * @return Action
169
     */
170 1
    public function setName($name)
171
    {
172 1
        $this->name = $name;
173 1
        return $this;
174
    }
175
176
    /**
177
     * @return mixed
178
     */
179 1
    public function getExecutor()
180
    {
181 1
        return $this->executor;
182
    }
183
184
    /**
185
     * @param mixed $executor
186
     * @return Action
187
     */
188 1
    public function setExecutor($executor)
189
    {
190 1
        $this->executor = $executor;
191 1
        return $this;
192
    }
193
194
    public function __toString()
195
    {
196
        return $this->getName();
197
    }
198
}
199