Completed
Push — master ( e657da...2322ba )
by Kirill
04:30
created

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