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 | * Constructor. |
||
74 | */ |
||
75 | public function __construct() |
||
81 | |||
82 | /** |
||
83 | * Get id. |
||
84 | * |
||
85 | * @return int |
||
86 | */ |
||
87 | public function getId(): int |
||
91 | |||
92 | /** |
||
93 | * Set name. |
||
94 | * |
||
95 | * @param string $name |
||
96 | * |
||
97 | * @return Poll |
||
98 | */ |
||
99 | public function setName(string $name) |
||
105 | |||
106 | /** |
||
107 | * Get name. |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | public function getName(): string |
||
115 | |||
116 | /** |
||
117 | * Set start. |
||
118 | * |
||
119 | * @param \DateTime $start |
||
120 | * |
||
121 | * @return Poll |
||
122 | */ |
||
123 | public function setStart(\DateTime $start) |
||
129 | |||
130 | /** |
||
131 | * Get start. |
||
132 | * |
||
133 | * @return \DateTime |
||
134 | */ |
||
135 | public function getStart(): DateTime |
||
139 | |||
140 | /** |
||
141 | * Set description. |
||
142 | * |
||
143 | * @param string $description |
||
144 | * |
||
145 | * @return Poll |
||
146 | */ |
||
147 | public function setDescription(string $description) |
||
153 | |||
154 | /** |
||
155 | * Get description. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | public function getDescription(): string |
||
163 | |||
164 | /** |
||
165 | * Set creator. |
||
166 | * |
||
167 | * @param \AppBundle\Entity\User $creator |
||
168 | * |
||
169 | * @return Poll |
||
170 | */ |
||
171 | public function setCreator(\AppBundle\Entity\User $creator = null) |
||
177 | |||
178 | /** |
||
179 | * Get creator. |
||
180 | * |
||
181 | * @return \AppBundle\Entity\User |
||
182 | */ |
||
183 | public function getCreator(): AppBundle\Entity\User |
||
187 | |||
188 | /** |
||
189 | * Add vote. |
||
190 | * |
||
191 | * @param \AppBundle\Entity\Vote $vote |
||
192 | * |
||
193 | * @return Poll |
||
194 | */ |
||
195 | public function addVote(\AppBundle\Entity\Vote $vote) |
||
201 | |||
202 | /** |
||
203 | * Remove vote. |
||
204 | * |
||
205 | * @param \AppBundle\Entity\Vote $vote |
||
206 | */ |
||
207 | public function removeVote(\AppBundle\Entity\Vote $vote) |
||
211 | |||
212 | /** |
||
213 | * Get votes. |
||
214 | * |
||
215 | * @return \Doctrine\Common\Collections\Collection |
||
216 | */ |
||
217 | public function getVotes() |
||
221 | |||
222 | /** |
||
223 | * Add choice. |
||
224 | * |
||
225 | * @param \AppBundle\Entity\Choice $choice |
||
226 | * |
||
227 | * @return Poll |
||
228 | */ |
||
229 | public function addChoice(\AppBundle\Entity\Choice $choice) |
||
235 | |||
236 | /** |
||
237 | * Remove choice. |
||
238 | * |
||
239 | * @param \AppBundle\Entity\Choice $choice |
||
240 | */ |
||
241 | public function removeChoice(\AppBundle\Entity\Choice $choice) |
||
245 | |||
246 | /** |
||
247 | * Get choices. |
||
248 | * |
||
249 | * @return \Doctrine\Common\Collections\Collection |
||
250 | */ |
||
251 | public function getChoices() |
||
255 | |||
256 | /** |
||
257 | * Set pollType |
||
258 | * |
||
259 | * @param \AppBundle\Entity\PollType $pollType |
||
260 | * |
||
261 | * @return Poll |
||
262 | */ |
||
263 | public function setPollType(\AppBundle\Entity\PollType $pollType = null) |
||
269 | |||
270 | /** |
||
271 | * Get pollType |
||
272 | * |
||
273 | * @return \AppBundle\Entity\PollType |
||
274 | */ |
||
275 | public function getPollType() |
||
279 | } |
||
280 |