Completed
Branch master (030db8)
by Kirill
02:25
created

Variable::setSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
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="vars")
10
 */
11
class Variable
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="text")
27
     */
28
    private $description;
29
30
    /**
31
     * @ORM\Column(type="text")
32
     */
33
    private $source;
34
35
    /**
36
     * @ORM\Column(type="string")
37
     */
38
    private $parser;
39
40
41
    /**
42
     * @ORM\Column(type="string", nullable=true)
43
     */
44
    private $value;
45
46
    /**
47
     * @ORM\Column(type="datetime", nullable=true)
48
     */
49
    private $lastupdate;
50
    /**
51
     * @ORM\Column(type="integer", nullable=true)
52
     */
53
    private $laststatus;
54
55
    /**
56
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\VariableHistory", mappedBy="var")
57
     */
58
    public $history;
59
60
    /**
61
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\Widget", mappedBy="variable")
62
     */
63
    public $widgets;
64
65
    /**
66
     * @return mixed
67
     */
68 1
    public function getId()
69
    {
70 1
        return $this->id;
71
    }
72
73
74
    /**
75
     * @return mixed
76
     */
77 3
    public function getName()
78
    {
79 3
        return $this->name;
80
    }
81
82
    /**
83
     * @param mixed $name
84
     * @return Variable
85
     */
86 6
    public function setName($name)
87
    {
88 6
        $this->name = $name;
89 6
        return $this;
90
    }
91
92
    /**
93
     * @return mixed
94
     */
95
    public function getDescription()
96
    {
97
        return $this->description;
98
    }
99
100
    /**
101
     * @param mixed $description
102
     * @return Variable
103
     */
104 6
    public function setDescription($description)
105
    {
106 6
        $this->description = $description;
107 6
        return $this;
108
    }
109
110
    /**
111
     * @return mixed
112
     */
113
    public function getSource()
114
    {
115
        return $this->source;
116
    }
117
118
    /**
119
     * @param mixed $source
120
     * @return Variable
121
     */
122 6
    public function setSource($source)
123
    {
124 6
        $this->source = $source;
125 6
        return $this;
126
    }
127
128
    /**
129
     * @return mixed
130
     */
131 3
    public function getParser()
132
    {
133 3
        return $this->parser;
134
    }
135
136
    /**
137
     * @param mixed $parser
138
     * @return Variable
139
     */
140 6
    public function setParser($parser)
141
    {
142 6
        $this->parser = $parser;
143 6
        return $this;
144
    }
145
146
    /**
147
     * @return mixed
148
     */
149 6
    public function getValue()
150
    {
151 6
        return $this->value;
152
    }
153
154
    /**
155
     * @param mixed $value
156
     * @return Variable
157
     */
158 6
    public function setValue($value)
159
    {
160 6
        $this->value = $value;
161 6
        return $this;
162
    }
163
164
    /**
165
     * @return mixed
166
     */
167 1
    public function getLastupdate()
168
    {
169 1
        return $this->lastupdate;
170
    }
171
172
    /**
173
     * @param mixed $lastupdate
174
     * @return Variable
175
     */
176 2
    public function setLastupdate($lastupdate)
177
    {
178 2
        $this->lastupdate = $lastupdate;
179 2
        return $this;
180
    }
181
182
    /**
183
     * @return mixed
184
     */
185 1
    public function getLaststatus()
186
    {
187 1
        return $this->laststatus;
188
    }
189
190
    /**
191
     * @param mixed $laststatus
192
     * @return Variable
193
     */
194 2
    public function setLaststatus($laststatus)
195
    {
196 2
        $this->laststatus = $laststatus;
197 2
        return $this;
198
    }
199
200
    public function __toString()
201
    {
202
        return $this->getName().' ('.$this->getValue().')';
203
    }
204
}
205