1 | <?php |
||
16 | class SurveyType |
||
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 | */ |
||
27 | private $id; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | * @Assert\NotBlank() |
||
32 | * @Assert\Type("string") |
||
33 | * @Assert\Length( |
||
34 | * min = 2, |
||
35 | * max = 190 |
||
36 | * ) |
||
37 | * @ORM\Column(type="string", length=190, unique=true) |
||
38 | * @Groups({"group1"}) |
||
39 | */ |
||
40 | private $name; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | * @Assert\Type("string") |
||
45 | * @Assert\Length( |
||
46 | * min = 2, |
||
47 | * max = 500 |
||
48 | * ) |
||
49 | * @ORM\Column(type="string", length=500, nullable=true) |
||
50 | * @Groups({"group2"}) |
||
51 | */ |
||
52 | private $description; |
||
53 | |||
54 | /** |
||
55 | * @var ArrayCollection[SurveyTypeSection] |
||
56 | * @ORM\OneToMany(targetEntity="SurveyTypeSection", mappedBy="surveyType", cascade={"persist", "remove"}) |
||
57 | * @Groups({"group2"}) |
||
58 | */ |
||
59 | private $sections; |
||
60 | |||
61 | /** |
||
62 | * @var ArrayCollection[Survey] |
||
63 | * @ORM\OneToMany(targetEntity="Survey", mappedBy="type", cascade={"persist", "remove"}) |
||
64 | */ |
||
65 | private $surveys; |
||
66 | |||
67 | public function __construct() |
||
72 | |||
73 | /** |
||
74 | * Get id. |
||
75 | * |
||
76 | * @return int |
||
77 | */ |
||
78 | public function getId() |
||
82 | |||
83 | /** |
||
84 | * Set name. |
||
85 | * |
||
86 | * @param string $name |
||
87 | * |
||
88 | * @return SurveyType |
||
89 | */ |
||
90 | public function setName($name) |
||
96 | |||
97 | /** |
||
98 | * Get name. |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | 5 | public function getName() |
|
106 | |||
107 | /** |
||
108 | * Set description. |
||
109 | * |
||
110 | * @param string $description |
||
111 | * |
||
112 | * @return SurveyType |
||
113 | */ |
||
114 | public function setDescription($description) |
||
120 | |||
121 | /** |
||
122 | * Get description. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 3 | public function getDescription() |
|
130 | |||
131 | /** |
||
132 | * Get SurveysTypeSection. |
||
133 | * |
||
134 | * @return ArrayCollection |
||
135 | */ |
||
136 | 4 | public function getSections() |
|
140 | |||
141 | /** |
||
142 | * Get Surveys. |
||
143 | * |
||
144 | * @return ArrayCollection |
||
145 | */ |
||
146 | public function getSurveys() |
||
150 | |||
151 | /** |
||
152 | * Add section. |
||
153 | * |
||
154 | * @param \AppBundle\Entity\Survey\SurveyTypeSection $section |
||
155 | * |
||
156 | * @return SurveyType |
||
157 | */ |
||
158 | public function addSection(\AppBundle\Entity\Survey\SurveyTypeSection $section) |
||
164 | |||
165 | /** |
||
166 | * Remove section. |
||
167 | * |
||
168 | * @param \AppBundle\Entity\Survey\SurveyTypeSection $section |
||
169 | */ |
||
170 | public function removeSection(\AppBundle\Entity\Survey\SurveyTypeSection $section) |
||
174 | |||
175 | /** |
||
176 | * Add survey. |
||
177 | * |
||
178 | * @param \AppBundle\Entity\Survey\Survey $survey |
||
179 | * |
||
180 | * @return SurveyType |
||
181 | */ |
||
182 | public function addSurvey(\AppBundle\Entity\Survey\Survey $survey) |
||
188 | |||
189 | /** |
||
190 | * Remove survey. |
||
191 | * |
||
192 | * @param \AppBundle\Entity\Survey\Survey $survey |
||
193 | */ |
||
194 | public function removeSurvey(\AppBundle\Entity\Survey\Survey $survey) |
||
198 | } |
||
199 |