|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PlaygroundGame\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
7
|
|
|
use Doctrine\ORM\Mapping\HasLifecycleCallbacks; |
|
8
|
|
|
use Doctrine\ORM\Mapping\PrePersist; |
|
9
|
|
|
use Doctrine\ORM\Mapping\PreUpdate; |
|
10
|
|
|
use Zend\InputFilter\InputFilter; |
|
11
|
|
|
use Zend\InputFilter\InputFilterAwareInterface; |
|
12
|
|
|
use Zend\InputFilter\InputFilterInterface; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* @ORM\Entity @HasLifecycleCallbacks |
|
16
|
|
|
* @ORM\Table(name="game_quiz_reply_answer") |
|
17
|
|
|
*/ |
|
18
|
|
|
class QuizReplyAnswer implements InputFilterAwareInterface |
|
19
|
|
|
{ |
|
20
|
|
|
protected $inputFilter; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @ORM\Id |
|
24
|
|
|
* @ORM\Column(type="integer"); |
|
25
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
26
|
|
|
*/ |
|
27
|
|
|
protected $id; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @ORM\ManyToOne(targetEntity="QuizReply", inversedBy="answers") |
|
31
|
|
|
* @ORM\JoinColumn(name="reply_id", referencedColumnName="id", onDelete="CASCADE") |
|
32
|
|
|
**/ |
|
33
|
|
|
protected $reply; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @ORM\Column(type="integer") |
|
37
|
|
|
**/ |
|
38
|
|
|
protected $question_id; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @ORM\Column(type="text") |
|
42
|
|
|
**/ |
|
43
|
|
|
protected $question; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @ORM\Column(type="integer") |
|
47
|
|
|
**/ |
|
48
|
|
|
protected $answer_id; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @ORM\Column(type="text") |
|
52
|
|
|
**/ |
|
53
|
|
|
protected $answer; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @ORM\Column(type="integer") |
|
57
|
|
|
**/ |
|
58
|
|
|
protected $points; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @ORM\Column(type="boolean", length=255, nullable=false) |
|
62
|
|
|
*/ |
|
63
|
|
|
protected $correct; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @ORM\Column(name="answer_data", type="text", nullable=true) |
|
67
|
|
|
*/ |
|
68
|
|
|
protected $answerData; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @ORM\Column(type="datetime") |
|
72
|
|
|
*/ |
|
73
|
|
|
protected $created_at; |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @ORM\Column(type="datetime") |
|
77
|
|
|
*/ |
|
78
|
|
|
protected $updated_at; |
|
79
|
|
|
|
|
80
|
|
|
public function __construct() |
|
81
|
|
|
{ |
|
82
|
|
|
$this->answers = new ArrayCollection(); |
|
|
|
|
|
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @PrePersist |
|
87
|
|
|
*/ |
|
88
|
|
|
public function createChrono() |
|
89
|
|
|
{ |
|
90
|
|
|
$this->created_at = new \DateTime("now"); |
|
91
|
|
|
$this->updated_at = new \DateTime("now"); |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @PreUpdate |
|
96
|
|
|
*/ |
|
97
|
|
|
public function updateChrono() |
|
98
|
|
|
{ |
|
99
|
|
|
$this->updated_at = new \DateTime("now"); |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* @return the unknown_type |
|
104
|
|
|
*/ |
|
105
|
|
|
public function getId() |
|
106
|
|
|
{ |
|
107
|
|
|
return $this->id; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* @param unknown_type $id |
|
112
|
|
|
*/ |
|
113
|
|
|
public function setId($id) |
|
114
|
|
|
{ |
|
115
|
|
|
$this->id = $id; |
|
116
|
|
|
|
|
117
|
|
|
return $this; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* @return QuizReply |
|
122
|
|
|
*/ |
|
123
|
|
|
public function getReply() |
|
124
|
|
|
{ |
|
125
|
|
|
return $this->reply; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* @param QuizReply $reply |
|
130
|
|
|
*/ |
|
131
|
|
|
public function setReply($reply) |
|
132
|
|
|
{ |
|
133
|
|
|
$this->reply = $reply; |
|
134
|
|
|
|
|
135
|
|
|
return $this; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* @return string |
|
140
|
|
|
*/ |
|
141
|
|
|
public function getQuestion() |
|
142
|
|
|
{ |
|
143
|
|
|
return $this->question; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* @param string $question |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setQuestion($question) |
|
150
|
|
|
{ |
|
151
|
|
|
$this->question = $question; |
|
152
|
|
|
|
|
153
|
|
|
return $this; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* @return string |
|
158
|
|
|
*/ |
|
159
|
|
|
public function getQuestionId() |
|
160
|
|
|
{ |
|
161
|
|
|
return $this->question_id; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* @param string $questionId |
|
166
|
|
|
*/ |
|
167
|
|
|
public function setQuestionId($questionId) |
|
168
|
|
|
{ |
|
169
|
|
|
$this->question_id = $questionId; |
|
170
|
|
|
|
|
171
|
|
|
return $this; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
/** |
|
175
|
|
|
* @return the unknown_type |
|
176
|
|
|
*/ |
|
177
|
|
|
public function getAnswer() |
|
178
|
|
|
{ |
|
179
|
|
|
return $this->answer; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
/** |
|
183
|
|
|
* @param unknown_type $answer |
|
184
|
|
|
*/ |
|
185
|
|
|
public function setAnswer($answer) |
|
186
|
|
|
{ |
|
187
|
|
|
$this->answer = $answer; |
|
188
|
|
|
|
|
189
|
|
|
return $this; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
/** |
|
193
|
|
|
* @return the unknown_type |
|
194
|
|
|
*/ |
|
195
|
|
|
public function getAnswerId() |
|
196
|
|
|
{ |
|
197
|
|
|
return $this->answer_id; |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
/** |
|
201
|
|
|
* @param unknown_type $answerId |
|
202
|
|
|
*/ |
|
203
|
|
|
public function setAnswerId($answerId) |
|
204
|
|
|
{ |
|
205
|
|
|
$this->answer_id = $answerId; |
|
206
|
|
|
|
|
207
|
|
|
return $this; |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
/** |
|
211
|
|
|
* @return the $points |
|
212
|
|
|
*/ |
|
213
|
|
|
public function getPoints() |
|
214
|
|
|
{ |
|
215
|
|
|
return $this->points; |
|
216
|
|
|
} |
|
217
|
|
|
|
|
218
|
|
|
/** |
|
219
|
|
|
* @param field_type $points |
|
220
|
|
|
*/ |
|
221
|
|
|
public function setPoints($points) |
|
222
|
|
|
{ |
|
223
|
|
|
$this->points = $points; |
|
224
|
|
|
|
|
225
|
|
|
return $this; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* @return the unknown_type |
|
230
|
|
|
*/ |
|
231
|
|
|
public function getCorrect() |
|
232
|
|
|
{ |
|
233
|
|
|
return $this->correct; |
|
234
|
|
|
} |
|
235
|
|
|
|
|
236
|
|
|
/** |
|
237
|
|
|
* @param unknown_type $correct |
|
238
|
|
|
*/ |
|
239
|
|
|
public function setCorrect($correct) |
|
240
|
|
|
{ |
|
241
|
|
|
$this->correct = $correct; |
|
242
|
|
|
|
|
243
|
|
|
return $this; |
|
244
|
|
|
} |
|
245
|
|
|
|
|
246
|
|
|
/** |
|
247
|
|
|
* @return string |
|
248
|
|
|
*/ |
|
249
|
|
|
public function getAnswerData() |
|
250
|
|
|
{ |
|
251
|
|
|
return $this->answerData; |
|
252
|
|
|
} |
|
253
|
|
|
|
|
254
|
|
|
/** |
|
255
|
|
|
* @param string $answerData |
|
256
|
|
|
*/ |
|
257
|
|
|
public function setAnswerData($answerData) |
|
258
|
|
|
{ |
|
259
|
|
|
$this->answerData = $answerData; |
|
260
|
|
|
|
|
261
|
|
|
return $this; |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* @return the unknown_type |
|
266
|
|
|
*/ |
|
267
|
|
|
public function getUpdatedAt() |
|
268
|
|
|
{ |
|
269
|
|
|
return $this->updated_at; |
|
270
|
|
|
} |
|
271
|
|
|
|
|
272
|
|
|
/** |
|
273
|
|
|
* @param unknown_type $updated_at |
|
274
|
|
|
*/ |
|
275
|
|
|
public function setUpdatedAt($updated_at) |
|
276
|
|
|
{ |
|
277
|
|
|
$this->updated_at = $updated_at; |
|
278
|
|
|
|
|
279
|
|
|
return $this; |
|
280
|
|
|
} |
|
281
|
|
|
|
|
282
|
|
|
/** |
|
283
|
|
|
* @return the unknown_type |
|
284
|
|
|
*/ |
|
285
|
|
|
public function getCreatedAt() |
|
286
|
|
|
{ |
|
287
|
|
|
return $this->created_at; |
|
288
|
|
|
} |
|
289
|
|
|
|
|
290
|
|
|
/** |
|
291
|
|
|
* @param unknown_type $created_at |
|
292
|
|
|
*/ |
|
293
|
|
|
public function setCreatedAt($created_at) |
|
294
|
|
|
{ |
|
295
|
|
|
$this->created_at = $created_at; |
|
296
|
|
|
|
|
297
|
|
|
return $this; |
|
298
|
|
|
} |
|
299
|
|
|
|
|
300
|
|
|
/** |
|
301
|
|
|
* Convert the object to an array. |
|
302
|
|
|
* |
|
303
|
|
|
* @return array |
|
304
|
|
|
*/ |
|
305
|
|
|
public function getArrayCopy() |
|
306
|
|
|
{ |
|
307
|
|
|
$obj_vars = get_object_vars($this); |
|
308
|
|
|
|
|
309
|
|
|
return $obj_vars; |
|
310
|
|
|
} |
|
311
|
|
|
|
|
312
|
|
|
/** |
|
313
|
|
|
* Populate from an array. |
|
314
|
|
|
* |
|
315
|
|
|
* @param array $data |
|
316
|
|
|
*/ |
|
317
|
|
|
public function populate($data = array()) |
|
|
|
|
|
|
318
|
|
|
{ |
|
319
|
|
|
} |
|
320
|
|
|
|
|
321
|
|
|
public function setInputFilter(InputFilterInterface $inputFilter) |
|
322
|
|
|
{ |
|
323
|
|
|
throw new \Exception("Not used"); |
|
324
|
|
|
} |
|
325
|
|
|
|
|
326
|
|
|
public function getInputFilter() |
|
327
|
|
|
{ |
|
328
|
|
|
if (!$this->inputFilter) { |
|
329
|
|
|
$inputFilter = new InputFilter(); |
|
330
|
|
|
|
|
331
|
|
|
$this->inputFilter = $inputFilter; |
|
332
|
|
|
} |
|
333
|
|
|
|
|
334
|
|
|
return $this->inputFilter; |
|
335
|
|
|
} |
|
336
|
|
|
} |
|
337
|
|
|
|
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.