1 | <?php |
||
14 | class Poll |
||
15 | { |
||
16 | /** |
||
17 | * @var int |
||
18 | * |
||
19 | * @ORM\Column(name="id", type="integer") |
||
20 | * @ORM\Id |
||
21 | * @ORM\GeneratedValue(strategy="AUTO") |
||
22 | */ |
||
23 | private $id; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | * |
||
28 | * @ORM\Column(name="name", type="string", length=255) |
||
29 | */ |
||
30 | private $name; |
||
31 | |||
32 | /** |
||
33 | * @var \DateTime |
||
34 | * |
||
35 | * @ORM\Column(name="start", type="datetime") |
||
36 | */ |
||
37 | private $start; |
||
38 | |||
39 | /** |
||
40 | * @var \AppBundle\Entity\User |
||
41 | * |
||
42 | * @ORM\ManyToOne(targetEntity="User", inversedBy="createdPolls") |
||
43 | * @ORM\JoinColumn(name="creator_id", referencedColumnName="id") |
||
44 | */ |
||
45 | private $creator; |
||
46 | |||
47 | /** |
||
48 | * @var \AppBundle\Entity\PollType |
||
49 | * |
||
50 | * @ORM\ManyToOne(targetEntity="PollType", inversedBy="polls") |
||
51 | * @ORM\JoinColumn(name="poll_type_id", referencedColumnName="id") |
||
52 | */ |
||
53 | private $pollType; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | * |
||
58 | * @ORM\Column(name="description", type="text", nullable=true) |
||
59 | */ |
||
60 | private $description; |
||
61 | |||
62 | /** |
||
63 | * @ORM\OneToMany(targetEntity="Vote", mappedBy="poll") |
||
64 | */ |
||
65 | private $votes; |
||
66 | |||
67 | /** |
||
68 | * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Choice") |
||
69 | */ |
||
70 | private $choices; |
||
71 | |||
72 | /** |
||
73 | * @var boolean |
||
74 | * |
||
75 | * @ORM\Column(name="active", type="boolean") |
||
76 | */ |
||
77 | private $active; |
||
78 | |||
79 | /** |
||
80 | * Constructor. |
||
81 | */ |
||
82 | public function __construct() |
||
88 | |||
89 | /** |
||
90 | * Get id. |
||
91 | * |
||
92 | * @return int |
||
93 | */ |
||
94 | public function getId(): int |
||
98 | |||
99 | /** |
||
100 | * Set name. |
||
101 | * |
||
102 | * @param string $name |
||
103 | * |
||
104 | * @return Poll |
||
105 | */ |
||
106 | public function setName(string $name) |
||
112 | |||
113 | /** |
||
114 | * Get name. |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getName(): string |
||
122 | |||
123 | /** |
||
124 | * Set start. |
||
125 | * |
||
126 | * @param \DateTime $start |
||
127 | * |
||
128 | * @return Poll |
||
129 | */ |
||
130 | public function setStart(\DateTime $start) |
||
136 | |||
137 | /** |
||
138 | * Get start. |
||
139 | * |
||
140 | * @return \DateTime |
||
141 | */ |
||
142 | public function getStart(): DateTime |
||
146 | |||
147 | /** |
||
148 | * Set description. |
||
149 | * |
||
150 | * @param string $description |
||
151 | * |
||
152 | * @return Poll |
||
153 | */ |
||
154 | public function setDescription(string $description) |
||
160 | |||
161 | /** |
||
162 | * Get description. |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | public function getDescription(): string |
||
170 | |||
171 | /** |
||
172 | * Set creator. |
||
173 | * |
||
174 | * @param \AppBundle\Entity\User $creator |
||
175 | * |
||
176 | * @return Poll |
||
177 | */ |
||
178 | public function setCreator(\AppBundle\Entity\User $creator = null) |
||
184 | |||
185 | /** |
||
186 | * Get creator. |
||
187 | * |
||
188 | * @return \AppBundle\Entity\User |
||
189 | */ |
||
190 | public function getCreator(): AppBundle\Entity\User |
||
194 | |||
195 | /** |
||
196 | * Add vote. |
||
197 | * |
||
198 | * @param \AppBundle\Entity\Vote $vote |
||
199 | * |
||
200 | * @return Poll |
||
201 | */ |
||
202 | public function addVote(\AppBundle\Entity\Vote $vote) |
||
208 | |||
209 | /** |
||
210 | * Remove vote. |
||
211 | * |
||
212 | * @param \AppBundle\Entity\Vote $vote |
||
213 | */ |
||
214 | public function removeVote(\AppBundle\Entity\Vote $vote) |
||
218 | |||
219 | /** |
||
220 | * Get votes. |
||
221 | * |
||
222 | * @return \Doctrine\Common\Collections\Collection |
||
223 | */ |
||
224 | public function getVotes() |
||
228 | |||
229 | /** |
||
230 | * Add choice. |
||
231 | * |
||
232 | * @param \AppBundle\Entity\Choice $choice |
||
233 | * |
||
234 | * @return Poll |
||
235 | */ |
||
236 | public function addChoice(\AppBundle\Entity\Choice $choice) |
||
242 | |||
243 | /** |
||
244 | * Remove choice. |
||
245 | * |
||
246 | * @param \AppBundle\Entity\Choice $choice |
||
247 | */ |
||
248 | public function removeChoice(\AppBundle\Entity\Choice $choice) |
||
252 | |||
253 | /** |
||
254 | * Get choices. |
||
255 | * |
||
256 | * @return \Doctrine\Common\Collections\Collection |
||
257 | */ |
||
258 | public function getChoices() |
||
262 | |||
263 | /** |
||
264 | * Set pollType |
||
265 | * |
||
266 | * @param \AppBundle\Entity\PollType $pollType |
||
267 | * |
||
268 | * @return Poll |
||
269 | */ |
||
270 | public function setPollType(\AppBundle\Entity\PollType $pollType = null) |
||
276 | |||
277 | /** |
||
278 | * Get pollType |
||
279 | * |
||
280 | * @return \AppBundle\Entity\PollType |
||
281 | */ |
||
282 | public function getPollType() |
||
286 | |||
287 | /** |
||
288 | * Set active |
||
289 | * |
||
290 | * @param boolean $active |
||
291 | * |
||
292 | * @return Poll |
||
293 | */ |
||
294 | public function setActive(bool $active) |
||
300 | |||
301 | /** |
||
302 | * Get active |
||
303 | * |
||
304 | * @return boolean |
||
305 | */ |
||
306 | public function getActive(): bool |
||
310 | } |
||
311 |