1 | <?php |
||
15 | class SurveyQuestion |
||
16 | { |
||
17 | /** |
||
18 | * @var int |
||
19 | * |
||
20 | * @ORM\Column(type="integer") |
||
21 | * @ORM\Id |
||
22 | * @ORM\GeneratedValue(strategy="AUTO") |
||
23 | * @Groups({"group2", "group3"}) |
||
24 | */ |
||
25 | private $id; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | * @Assert\NotBlank() |
||
30 | * @Assert\Type("string") |
||
31 | * @Assert\Length( |
||
32 | * max = 500 |
||
33 | * ) |
||
34 | * @ORM\Column(type="string") |
||
35 | * @Groups({"group2"}) |
||
36 | */ |
||
37 | private $title; |
||
38 | |||
39 | /** |
||
40 | * @var SurveyTypeSection |
||
41 | * @Assert\Type("object") |
||
42 | * @Assert\Valid |
||
43 | * @ORM\ManyToOne(targetEntity="SurveyTypeSection", inversedBy="questions") |
||
44 | */ |
||
45 | private $surveyTypeSection; |
||
46 | |||
47 | /** |
||
48 | * @var int |
||
49 | * @Assert\NotBlank() |
||
50 | * @Assert\Type("integer") |
||
51 | * @ORM\Column(type="integer") |
||
52 | * @Groups({"group2"}) |
||
53 | */ |
||
54 | private $orderNumber; |
||
55 | |||
56 | /** |
||
57 | * @var array |
||
58 | * @Assert\NotBlank() |
||
59 | * @Assert\Type("array") |
||
60 | * @ORM\Column(type="array") |
||
61 | * @Groups({"group2"}) |
||
62 | */ |
||
63 | private $variants; |
||
64 | |||
65 | /** |
||
66 | * @var ArrayCollection[SurveyAnswer] |
||
67 | * @ORM\OneToMany(targetEntity="SurveyAnswer", mappedBy="question", cascade={"persist", "remove"}) |
||
68 | */ |
||
69 | private $answers; |
||
70 | |||
71 | public function __construct() |
||
76 | |||
77 | /** |
||
78 | * Get id. |
||
79 | * |
||
80 | * @return int |
||
81 | */ |
||
82 | 3 | public function getId() |
|
86 | |||
87 | /** |
||
88 | * Set title. |
||
89 | * |
||
90 | * @param string $title |
||
91 | * |
||
92 | * @return SurveyQuestion |
||
93 | */ |
||
94 | public function setTitle($title) |
||
100 | |||
101 | /** |
||
102 | * Get title. |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | 3 | public function getTitle() |
|
110 | |||
111 | /** |
||
112 | * Set Survey Type Section. |
||
113 | * |
||
114 | * @param SurveyTypeSection $section |
||
115 | * |
||
116 | * @return SurveyQuestion |
||
117 | */ |
||
118 | public function setSurveyTypeSection(SurveyTypeSection $section) |
||
124 | |||
125 | /** |
||
126 | * Get Survey Type. |
||
127 | * |
||
128 | * @return SurveyTypeSection |
||
129 | */ |
||
130 | public function getSurveyTypeSection() |
||
134 | |||
135 | /** |
||
136 | * Set order number. |
||
137 | * |
||
138 | * @param int $number |
||
139 | * |
||
140 | * @return SurveyQuestion |
||
141 | */ |
||
142 | public function setOrderNumber($number) |
||
148 | |||
149 | /** |
||
150 | * Get order number. |
||
151 | * |
||
152 | * @return int |
||
153 | */ |
||
154 | public function getOrderNumber() |
||
158 | |||
159 | /** |
||
160 | * Set variants. |
||
161 | * |
||
162 | * @param array $variants |
||
163 | * |
||
164 | * @return SurveyQuestion |
||
165 | */ |
||
166 | public function setVariants($variants) |
||
172 | |||
173 | /** |
||
174 | * Add variant. |
||
175 | * |
||
176 | * @param string $variant |
||
177 | * |
||
178 | * @return SurveyQuestion |
||
179 | */ |
||
180 | public function addVariant($variant) |
||
188 | |||
189 | /** |
||
190 | * Get variants. |
||
191 | * |
||
192 | * @return array |
||
193 | */ |
||
194 | 4 | public function getVariants() |
|
198 | |||
199 | /** |
||
200 | * Get answers. |
||
201 | * |
||
202 | * @return ArrayCollection |
||
203 | */ |
||
204 | public function getAnswers() |
||
208 | } |
||
209 |