1 | <?php |
||
19 | class Test implements \JsonSerializable |
||
20 | { |
||
21 | /** |
||
22 | * @var integer |
||
23 | * |
||
24 | * @ORM\Column(name="id", type="integer") |
||
25 | * @ORM\Id |
||
26 | * @ORM\GeneratedValue(strategy="AUTO") |
||
27 | */ |
||
28 | private $id; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | * |
||
33 | * @ORM\Column(name="name", type="string", length=50, unique=true) |
||
34 | */ |
||
35 | private $name; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | * |
||
40 | * @ORM\Column(name="actual", type="string", length=100) |
||
41 | */ |
||
42 | private $actual; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | * |
||
47 | * @ORM\Column(name="expectation", type="string", length=50) |
||
48 | */ |
||
49 | private $expectation; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | * |
||
54 | * @ORM\Column(name="expected", type="string", length=100, nullable=true) |
||
55 | */ |
||
56 | private $expected; |
||
57 | |||
58 | /** |
||
59 | * @ORM\OneToMany(targetEntity="Overwatch\ResultBundle\Entity\TestResult", mappedBy="test") |
||
60 | */ |
||
61 | private $results; |
||
62 | |||
63 | /** |
||
64 | * @ORM\OneToOne(targetEntity="Overwatch\ResultBundle\Entity\TestResult") |
||
65 | * @ORM\JoinColumn(name="lastResult_id", referencedColumnName="id", onDelete="SET NULL") |
||
66 | */ |
||
67 | private $lastResult; |
||
68 | |||
69 | /** |
||
70 | * @ORM\ManyToOne(targetEntity="TestGroup", inversedBy="tests") |
||
71 | */ |
||
72 | private $group; |
||
73 | |||
74 | /** |
||
75 | * @var \DateTime |
||
76 | * |
||
77 | * @ORM\Column(name="created_at", type="datetime") |
||
78 | */ |
||
79 | private $createdAt; |
||
80 | |||
81 | /** |
||
82 | * @var \DateTime |
||
83 | * |
||
84 | * @ORM\Column(name="updated_at", type="datetime") |
||
85 | */ |
||
86 | private $updatedAt; |
||
87 | |||
88 | |||
89 | /** |
||
90 | * Constructor |
||
91 | */ |
||
92 | 148 | public function __construct() |
|
96 | |||
97 | /** |
||
98 | * To String |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | 4 | public function __toString() |
|
106 | |||
107 | /** |
||
108 | * Serialise object to JSON |
||
109 | */ |
||
110 | 10 | public function jsonSerialize() |
|
123 | |||
124 | /** |
||
125 | * Get id |
||
126 | * |
||
127 | * @return integer |
||
128 | */ |
||
129 | 18 | public function getId() |
|
133 | |||
134 | /** |
||
135 | * Set name |
||
136 | * |
||
137 | * @param string $name |
||
138 | * @return Test |
||
139 | */ |
||
140 | 137 | public function setName($name) |
|
146 | |||
147 | /** |
||
148 | * Get name |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | 128 | public function getName() |
|
156 | |||
157 | /** |
||
158 | * Set actual |
||
159 | * |
||
160 | * @param string $actual |
||
161 | * @return Test |
||
162 | */ |
||
163 | 135 | public function setActual($actual) |
|
169 | |||
170 | /** |
||
171 | * Get actual |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | 28 | public function getActual() |
|
179 | |||
180 | /** |
||
181 | * Set expectation |
||
182 | * |
||
183 | * @param string $expectation |
||
184 | * @return Test |
||
185 | */ |
||
186 | 135 | public function setExpectation($expectation) |
|
192 | |||
193 | /** |
||
194 | * Get expectation |
||
195 | * |
||
196 | * @return string |
||
197 | */ |
||
198 | 28 | public function getExpectation() |
|
202 | |||
203 | /** |
||
204 | * Set expected |
||
205 | * |
||
206 | * @param string $expected |
||
207 | * @return Test |
||
208 | */ |
||
209 | 3 | public function setExpected($expected) |
|
215 | |||
216 | /** |
||
217 | * Get expected |
||
218 | * |
||
219 | * @return string |
||
220 | */ |
||
221 | 26 | public function getExpected() |
|
225 | |||
226 | /** |
||
227 | * Set createdAt |
||
228 | * |
||
229 | * @ORM\PrePersist |
||
230 | * @return Test |
||
231 | */ |
||
232 | 129 | public function setCreatedAt() |
|
240 | |||
241 | /** |
||
242 | * Get createdAt |
||
243 | * |
||
244 | * @return \DateTime |
||
245 | */ |
||
246 | 11 | public function getCreatedAt() |
|
250 | |||
251 | /** |
||
252 | * Set updatedAt |
||
253 | * |
||
254 | * @ORM\PrePersist |
||
255 | * @ORM\PreUpdate |
||
256 | * @return Test |
||
257 | */ |
||
258 | 129 | public function setUpdatedAt() |
|
264 | |||
265 | /** |
||
266 | * Get updatedAt |
||
267 | * |
||
268 | * @return \DateTime |
||
269 | */ |
||
270 | 10 | public function getUpdatedAt() |
|
274 | |||
275 | /** |
||
276 | * Set group |
||
277 | * |
||
278 | * @param \Overwatch\TestBundle\Entity\TestGroup $group |
||
279 | * @return Test |
||
280 | */ |
||
281 | 127 | public function setGroup(\Overwatch\TestBundle\Entity\TestGroup $group = null) |
|
287 | |||
288 | /** |
||
289 | * Get group |
||
290 | * |
||
291 | * @return \Overwatch\TestBundle\Entity\TestGroup |
||
292 | */ |
||
293 | 127 | public function getGroup() |
|
297 | |||
298 | /** |
||
299 | * Add results |
||
300 | * |
||
301 | * @param \Overwatch\ResultBundle\Entity\TestResult $result |
||
302 | * @return Test |
||
303 | */ |
||
304 | 1 | public function addResult(\Overwatch\ResultBundle\Entity\TestResult $result) |
|
310 | |||
311 | /** |
||
312 | * Remove results |
||
313 | * |
||
314 | * @param \Overwatch\ResultBundle\Entity\TestResult $result |
||
315 | */ |
||
316 | public function removeResult(\Overwatch\ResultBundle\Entity\TestResult $result) |
||
320 | |||
321 | /** |
||
322 | * Get results |
||
323 | * |
||
324 | * @return \Doctrine\Common\Collections\Collection |
||
325 | */ |
||
326 | 3 | public function getResults() |
|
330 | |||
331 | /** |
||
332 | * Set last result |
||
333 | * |
||
334 | * @param \Overwatch\ResultBundle\Entity\TestResult $result |
||
335 | * @return \Overwatch\TestBundle\Entity\Test |
||
336 | */ |
||
337 | 135 | public function setLastResult(\Overwatch\ResultBundle\Entity\TestResult $result) |
|
343 | |||
344 | /** |
||
345 | * Get last result |
||
346 | * |
||
347 | * @return \Overwatch\ResultBundle\Entity\TestResult |
||
348 | */ |
||
349 | 10 | public function getLastResult() |
|
353 | } |
||
354 |