Completed
Push — master ( 5ac2a2...32410d )
by Kirill
06:44
created

Variable::getSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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
     * @ORM\Column(type="boolean");
66
     */
67
    public $needSync = true;
68
69
    /**
70
     * @ORM\Column(type="boolean")
71
     */
72
    public $needHistory = false;
73
74
    /**
75
     * @return mixed
76
     */
77
    public function getId()
78
    {
79
        return $this->id;
80
    }
81
82
83
    /**
84
     * @return mixed
85
     */
86 3
    public function getName()
87
    {
88 3
        return $this->name;
89
    }
90
91
    /**
92
     * @param mixed $name
93
     * @return Variable
94
     */
95 8
    public function setName($name)
96
    {
97 8
        $this->name = $name;
98 8
        return $this;
99
    }
100
101
    /**
102
     * @return mixed
103
     */
104
    public function getDescription()
105
    {
106
        return $this->description;
107
    }
108
109
    /**
110
     * @param mixed $description
111
     * @return Variable
112
     */
113 8
    public function setDescription($description)
114
    {
115 8
        $this->description = $description;
116 8
        return $this;
117
    }
118
119
    /**
120
     * @return mixed
121
     */
122
    public function getSource()
123
    {
124
        return $this->source;
125
    }
126
127
    /**
128
     * @param mixed $source
129
     * @return Variable
130
     */
131 8
    public function setSource($source)
132
    {
133 8
        $this->source = $source;
134 8
        return $this;
135
    }
136
137
    /**
138
     * @return mixed
139
     */
140 3
    public function getParser()
141
    {
142 3
        return $this->parser;
143
    }
144
145
    /**
146
     * @param mixed $parser
147
     * @return Variable
148
     */
149 8
    public function setParser($parser)
150
    {
151 8
        $this->parser = $parser;
152 8
        return $this;
153
    }
154
155
    /**
156
     * @return mixed
157
     */
158 7
    public function getValue()
159
    {
160 7
        return $this->value;
161
    }
162
163
    /**
164
     * @param mixed $value
165
     * @return Variable
166
     */
167 8
    public function setValue($value)
168
    {
169 8
        $this->value = $value;
170 8
        return $this;
171
    }
172
173
    /**
174
     * @return mixed
175
     */
176 1
    public function getLastupdate()
177
    {
178 1
        return $this->lastupdate;
179
    }
180
181
    /**
182
     * @param mixed $lastupdate
183
     * @return Variable
184
     */
185 3
    public function setLastupdate($lastupdate)
186
    {
187 3
        $this->lastupdate = $lastupdate;
188 3
        return $this;
189
    }
190
191
    /**
192
     * @return mixed
193
     */
194
    public function getLaststatus()
195
    {
196
        return $this->laststatus;
197
    }
198
199
    /**
200
     * @param mixed $laststatus
201
     * @return Variable
202
     */
203 3
    public function setLaststatus($laststatus)
204
    {
205 3
        $this->laststatus = $laststatus;
206 3
        return $this;
207
    }
208
209
    public function __toString()
210
    {
211
        return $this->getName().' ('.$this->getValue().')';
212
    }
213
}
214