1 | <?php |
||
16 | class SurveyTypeSection |
||
17 | { |
||
18 | use ORMBehaviors\Timestampable\Timestampable; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | * |
||
23 | * @ORM\Column(type="integer") |
||
24 | * @ORM\Id |
||
25 | * @ORM\GeneratedValue(strategy="AUTO") |
||
26 | * @Groups({"group2"}) |
||
27 | */ |
||
28 | private $id; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | * @Assert\NotBlank() |
||
33 | * @Assert\Type("string") |
||
34 | * @Assert\Length( |
||
35 | * min = 2, |
||
36 | * max = 190 |
||
37 | * ) |
||
38 | * @ORM\Column(type="string", length=190, nullable=true) |
||
39 | * @Groups({"group2"}) |
||
40 | */ |
||
41 | private $name; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | * @Assert\NotBlank() |
||
46 | * @Assert\Type("string") |
||
47 | * @Assert\Length( |
||
48 | * min = 2, |
||
49 | * max = 500 |
||
50 | * ) |
||
51 | * @ORM\Column(type="string", length=500, nullable=true) |
||
52 | * @Groups({"group2"}) |
||
53 | */ |
||
54 | private $description; |
||
55 | |||
56 | /** |
||
57 | * @var int |
||
58 | * @Assert\NotBlank() |
||
59 | * @Assert\Type("integer") |
||
60 | * @ORM\Column(type="integer") |
||
61 | * @Groups({"group2"}) |
||
62 | */ |
||
63 | private $orderNumber; |
||
64 | |||
65 | /** |
||
66 | * @var SurveyType |
||
67 | * @Assert\Type("object") |
||
68 | * @Assert\Valid |
||
69 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Survey\SurveyType", inversedBy="sections") |
||
70 | * @ORM\JoinColumn(onDelete="CASCADE") |
||
71 | */ |
||
72 | private $surveyType; |
||
73 | |||
74 | /** |
||
75 | * @var ArrayCollection[SurveyQuestion] |
||
76 | * @ORM\OneToMany(targetEntity="SurveyQuestion", mappedBy="surveyTypeSection", cascade={"persist", "remove"}) |
||
77 | * @Groups({"group2"}) |
||
78 | */ |
||
79 | private $questions; |
||
80 | |||
81 | public function __construct() |
||
85 | |||
86 | /** |
||
87 | * Get id. |
||
88 | * |
||
89 | * @return int |
||
90 | */ |
||
91 | public function getId() |
||
95 | |||
96 | /** |
||
97 | * Set name. |
||
98 | * |
||
99 | * @param string $name |
||
100 | * |
||
101 | * @return SurveyTypeSection |
||
102 | */ |
||
103 | public function setName($name) |
||
109 | |||
110 | /** |
||
111 | * Get name. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | 3 | public function getName() |
|
119 | |||
120 | /** |
||
121 | * Set description. |
||
122 | * |
||
123 | * @param string $description |
||
124 | * |
||
125 | * @return SurveyTypeSection |
||
126 | */ |
||
127 | public function setDescription($description) |
||
133 | |||
134 | /** |
||
135 | * Get description. |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | 3 | public function getDescription() |
|
143 | |||
144 | /** |
||
145 | * Set order number. |
||
146 | * |
||
147 | * @param int $number |
||
148 | * |
||
149 | * @return SurveyTypeSection |
||
150 | */ |
||
151 | public function setOrderNumber($number) |
||
157 | |||
158 | /** |
||
159 | * Get order number. |
||
160 | * |
||
161 | * @return int |
||
162 | */ |
||
163 | public function getOrderNumber() |
||
167 | |||
168 | /** |
||
169 | * Set survey type. |
||
170 | * |
||
171 | * @param SurveyType $type |
||
172 | * |
||
173 | * @return SurveyTypeSection |
||
174 | */ |
||
175 | public function setSurveyType(SurveyType $type) |
||
181 | |||
182 | /** |
||
183 | * Get type. |
||
184 | * |
||
185 | * @return SurveyType |
||
186 | */ |
||
187 | public function getSurveyType() |
||
191 | |||
192 | /** |
||
193 | * Get Questions. |
||
194 | * |
||
195 | * @return ArrayCollection |
||
196 | */ |
||
197 | 4 | public function getQuestions() |
|
201 | |||
202 | /** |
||
203 | * Add question. |
||
204 | * |
||
205 | * @param \AppBundle\Entity\Survey\SurveyQuestion $question |
||
206 | * |
||
207 | * @return SurveyTypeSection |
||
208 | */ |
||
209 | public function addQuestion(\AppBundle\Entity\Survey\SurveyQuestion $question) |
||
215 | |||
216 | /** |
||
217 | * Remove question. |
||
218 | * |
||
219 | * @param \AppBundle\Entity\Survey\SurveyQuestion $question |
||
220 | */ |
||
221 | public function removeQuestion(\AppBundle\Entity\Survey\SurveyQuestion $question) |
||
225 | } |
||
226 |