Completed
Push — master ( ac9b94...2050b8 )
by Julito
11:32
created

CSurveyQuestion::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * CSurveyQuestion.
12
 *
13
 * @ORM\Table(
14
 *  name="c_survey_question",
15
 *  indexes={
16
 *     @ORM\Index(name="course", columns={"c_id"}),
17
 *  }
18
 * )
19
 * @ORM\Entity
20
 */
21
class CSurveyQuestion
22
{
23
    /**
24
     * @var int
25
     *
26
     * @ORM\Column(name="iid", type="integer")
27
     * @ORM\Id
28
     * @ORM\GeneratedValue
29
     */
30
    protected $iid;
31
32
    /**
33
     * @var CSurveyQuestion
34
     *
35
     * @ORM\ManyToOne(targetEntity="CSurveyQuestion", inversedBy="children")
36
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="iid")
37
     */
38
    protected $parent;
39
40
    /**
41
     * @var ArrayCollection|CSurveyQuestion[]
42
     * @ORM\OneToMany(targetEntity="CSurveyQuestion", mappedBy="parentEvent")
43
     */
44
    protected $children;
45
46
    /**
47
     * @var CSurveyQuestionOption
48
     *
49
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CSurveyQuestionOption")
50
     * @ORM\JoinColumn(name="parent_option_id", referencedColumnName="iid")
51
     */
52
    protected $parentOption;
53
54
    /**
55
     * @var int
56
     *
57
     * @ORM\Column(name="c_id", type="integer")
58
     */
59
    protected $cId;
60
61
    /**
62
     * @var int
63
     *
64
     * @ORM\Column(name="survey_id", type="integer", nullable=false)
65
     */
66
    protected $surveyId;
67
68
    /**
69
     * @var string
70
     *
71
     * @ORM\Column(name="survey_question", type="text", nullable=false)
72
     */
73
    protected $surveyQuestion;
74
75
    /**
76
     * @var string
77
     *
78
     * @ORM\Column(name="survey_question_comment", type="text", nullable=false)
79
     */
80
    protected $surveyQuestionComment;
81
82
    /**
83
     * @var string
84
     *
85
     * @ORM\Column(name="type", type="string", length=250, nullable=false)
86
     */
87
    protected $type;
88
89
    /**
90
     * @var string
91
     *
92
     * @ORM\Column(name="display", type="string", length=10, nullable=false)
93
     */
94
    protected $display;
95
96
    /**
97
     * @var int
98
     *
99
     * @ORM\Column(name="sort", type="integer", nullable=false)
100
     */
101
    protected $sort;
102
103
    /**
104
     * @var int
105
     *
106
     * @ORM\Column(name="shared_question_id", type="integer", nullable=true)
107
     */
108
    protected $sharedQuestionId;
109
110
    /**
111
     * @var int
112
     *
113
     * @ORM\Column(name="max_value", type="integer", nullable=true)
114
     */
115
    protected $maxValue;
116
117
    /**
118
     * @var int
119
     *
120
     * @ORM\Column(name="survey_group_pri", type="integer", nullable=false)
121
     */
122
    protected $surveyGroupPri;
123
124
    /**
125
     * @var int
126
     *
127
     * @ORM\Column(name="survey_group_sec1", type="integer", nullable=false)
128
     */
129
    protected $surveyGroupSec1;
130
131
    /**
132
     * @var int
133
     *
134
     * @ORM\Column(name="survey_group_sec2", type="integer", nullable=false)
135
     */
136
    protected $surveyGroupSec2;
137
138
    /**
139
     * @var bool
140
     *
141
     * @ORM\Column(name="is_required", type="boolean", options={"default": false})
142
     */
143
    protected $isMandatory = false;
144
145
    public function __construct()
146
    {
147
        $this->surveyGroupPri = '';
0 ignored issues
show
Documentation Bug introduced by
The property $surveyGroupPri was declared of type integer, but '' is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
148
        $this->surveyGroupSec1 = '';
0 ignored issues
show
Documentation Bug introduced by
The property $surveyGroupSec1 was declared of type integer, but '' is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
149
        $this->surveyGroupSec2 = '';
0 ignored issues
show
Documentation Bug introduced by
The property $surveyGroupSec2 was declared of type integer, but '' is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
150
    }
151
152
    public function getIid(): int
153
    {
154
        return $this->iid;
155
    }
156
157
    /**
158
     * Set surveyId.
159
     *
160
     * @param int $surveyId
161
     *
162
     * @return CSurveyQuestion
163
     */
164
    public function setSurveyId($surveyId)
165
    {
166
        $this->surveyId = $surveyId;
167
168
        return $this;
169
    }
170
171
    /**
172
     * Get surveyId.
173
     *
174
     * @return int
175
     */
176
    public function getSurveyId()
177
    {
178
        return $this->surveyId;
179
    }
180
181
    /**
182
     * Set surveyQuestion.
183
     *
184
     * @param string $surveyQuestion
185
     *
186
     * @return CSurveyQuestion
187
     */
188
    public function setSurveyQuestion($surveyQuestion)
189
    {
190
        $this->surveyQuestion = $surveyQuestion;
191
192
        return $this;
193
    }
194
195
    /**
196
     * Get surveyQuestion.
197
     *
198
     * @return string
199
     */
200
    public function getSurveyQuestion()
201
    {
202
        return $this->surveyQuestion;
203
    }
204
205
    /**
206
     * Set surveyQuestionComment.
207
     *
208
     * @param string $surveyQuestionComment
209
     *
210
     * @return CSurveyQuestion
211
     */
212
    public function setSurveyQuestionComment($surveyQuestionComment)
213
    {
214
        $this->surveyQuestionComment = $surveyQuestionComment;
215
216
        return $this;
217
    }
218
219
    /**
220
     * Get surveyQuestionComment.
221
     *
222
     * @return string
223
     */
224
    public function getSurveyQuestionComment()
225
    {
226
        return $this->surveyQuestionComment;
227
    }
228
229
    /**
230
     * Set type.
231
     *
232
     * @param string $type
233
     *
234
     * @return CSurveyQuestion
235
     */
236
    public function setType($type)
237
    {
238
        $this->type = $type;
239
240
        return $this;
241
    }
242
243
    /**
244
     * Get type.
245
     *
246
     * @return string
247
     */
248
    public function getType()
249
    {
250
        return $this->type;
251
    }
252
253
    /**
254
     * Set display.
255
     *
256
     * @param string $display
257
     *
258
     * @return CSurveyQuestion
259
     */
260
    public function setDisplay($display)
261
    {
262
        $this->display = $display;
263
264
        return $this;
265
    }
266
267
    /**
268
     * Get display.
269
     *
270
     * @return string
271
     */
272
    public function getDisplay()
273
    {
274
        return $this->display;
275
    }
276
277
    /**
278
     * Set sort.
279
     *
280
     * @param int $sort
281
     *
282
     * @return CSurveyQuestion
283
     */
284
    public function setSort($sort)
285
    {
286
        $this->sort = $sort;
287
288
        return $this;
289
    }
290
291
    /**
292
     * Get sort.
293
     *
294
     * @return int
295
     */
296
    public function getSort()
297
    {
298
        return $this->sort;
299
    }
300
301
    /**
302
     * Set sharedQuestionId.
303
     *
304
     * @param int $sharedQuestionId
305
     *
306
     * @return CSurveyQuestion
307
     */
308
    public function setSharedQuestionId($sharedQuestionId)
309
    {
310
        $this->sharedQuestionId = (int) $sharedQuestionId;
311
312
        return $this;
313
    }
314
315
    /**
316
     * Get sharedQuestionId.
317
     *
318
     * @return int
319
     */
320
    public function getSharedQuestionId()
321
    {
322
        return $this->sharedQuestionId;
323
    }
324
325
    /**
326
     * Set maxValue.
327
     *
328
     * @param int $maxValue
329
     *
330
     * @return CSurveyQuestion
331
     */
332
    public function setMaxValue($maxValue)
333
    {
334
        $this->maxValue = $maxValue;
335
336
        return $this;
337
    }
338
339
    /**
340
     * Get maxValue.
341
     *
342
     * @return int
343
     */
344
    public function getMaxValue()
345
    {
346
        return $this->maxValue;
347
    }
348
349
    /**
350
     * Set surveyGroupPri.
351
     *
352
     * @param int $surveyGroupPri
353
     *
354
     * @return CSurveyQuestion
355
     */
356
    public function setSurveyGroupPri($surveyGroupPri)
357
    {
358
        $this->surveyGroupPri = $surveyGroupPri;
359
360
        return $this;
361
    }
362
363
    /**
364
     * Get surveyGroupPri.
365
     *
366
     * @return int
367
     */
368
    public function getSurveyGroupPri()
369
    {
370
        return $this->surveyGroupPri;
371
    }
372
373
    /**
374
     * Set surveyGroupSec1.
375
     *
376
     * @param int $surveyGroupSec1
377
     *
378
     * @return CSurveyQuestion
379
     */
380
    public function setSurveyGroupSec1($surveyGroupSec1)
381
    {
382
        $this->surveyGroupSec1 = $surveyGroupSec1;
383
384
        return $this;
385
    }
386
387
    /**
388
     * Get surveyGroupSec1.
389
     *
390
     * @return int
391
     */
392
    public function getSurveyGroupSec1()
393
    {
394
        return $this->surveyGroupSec1;
395
    }
396
397
    /**
398
     * Set surveyGroupSec2.
399
     *
400
     * @param int $surveyGroupSec2
401
     *
402
     * @return CSurveyQuestion
403
     */
404
    public function setSurveyGroupSec2($surveyGroupSec2)
405
    {
406
        $this->surveyGroupSec2 = $surveyGroupSec2;
407
408
        return $this;
409
    }
410
411
    /**
412
     * Get surveyGroupSec2.
413
     *
414
     * @return int
415
     */
416
    public function getSurveyGroupSec2()
417
    {
418
        return $this->surveyGroupSec2;
419
    }
420
421
    /**
422
     * Set cId.
423
     *
424
     * @param int $cId
425
     *
426
     * @return CSurveyQuestion
427
     */
428
    public function setCId($cId)
429
    {
430
        $this->cId = $cId;
431
432
        return $this;
433
    }
434
435
    /**
436
     * Get cId.
437
     *
438
     * @return int
439
     */
440
    public function getCId()
441
    {
442
        return $this->cId;
443
    }
444
445
    /**
446
     * Set isMandatory.
447
     */
448
    public function isMandatory(): bool
449
    {
450
        return $this->isMandatory;
451
    }
452
453
    /**
454
     * Get isMandatory.
455
     */
456
    public function setIsMandatory(bool $isMandatory): self
457
    {
458
        $this->isMandatory = $isMandatory;
459
460
        return $this;
461
    }
462
463
    public function getParent(): CSurveyQuestion
464
    {
465
        return $this->parent;
466
    }
467
468
    public function setParent(CSurveyQuestion $parent): self
469
    {
470
        $this->parent = $parent;
471
472
        return $this;
473
    }
474
475
    /**
476
     * @return CSurveyQuestion[]|ArrayCollection
477
     */
478
    public function getChildren()
479
    {
480
        return $this->children;
481
    }
482
483
    /**
484
     * @param CSurveyQuestion[]|ArrayCollection $children
485
     */
486
    public function setChildren($children): self
487
    {
488
        $this->children = $children;
489
490
        return $this;
491
    }
492
493
    public function getParentOption(): CSurveyQuestionOption
494
    {
495
        return $this->parentOption;
496
    }
497
498
    public function setParentOption(CSurveyQuestionOption $parentOption): self
499
    {
500
        $this->parentOption = $parentOption;
501
502
        return $this;
503
    }
504
}
505