1 | <?php |
||
16 | class Poll |
||
17 | { |
||
18 | /** |
||
19 | * @var int |
||
20 | * |
||
21 | * @ORM\Column(name="id", type="integer") |
||
22 | * @ORM\Id |
||
23 | * @ORM\GeneratedValue(strategy="AUTO") |
||
24 | */ |
||
25 | private $id; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | * |
||
30 | * @ORM\Column(name="name", type="string", length=255) |
||
31 | */ |
||
32 | private $name; |
||
33 | |||
34 | /** |
||
35 | * @var \DateTime |
||
36 | * |
||
37 | * @ORM\Column(name="start", type="datetime") |
||
38 | */ |
||
39 | private $start; |
||
40 | |||
41 | /** |
||
42 | * @var \User |
||
43 | * |
||
44 | * @ORM\ManyToOne(targetEntity="User", inversedBy="polls") |
||
45 | * @ORM\JoinColumn(name="creator_id", referencedColumnName="id") |
||
46 | */ |
||
47 | private $creator; |
||
48 | |||
49 | /** |
||
50 | * @var \PollType |
||
51 | * |
||
52 | * @ORM\ManyToOne(targetEntity="PollType", inversedBy="polls") |
||
53 | * @ORM\JoinColumn(name="poll_type_id", referencedColumnName="id") |
||
54 | */ |
||
55 | private $pollType; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | * |
||
60 | * @ORM\Column(name="description", type="text", nullable=true) |
||
61 | */ |
||
62 | private $description; |
||
63 | |||
64 | /** |
||
65 | * @ORM\OneToMany(targetEntity="Vote", mappedBy="poll") |
||
66 | */ |
||
67 | private $votes; |
||
68 | |||
69 | /** |
||
70 | * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Choice") |
||
71 | */ |
||
72 | private $choices; |
||
73 | |||
74 | /** |
||
75 | * Constructor |
||
76 | */ |
||
77 | public function __construct() |
||
82 | |||
83 | /** |
||
84 | * Get id |
||
85 | * |
||
86 | * @return integer |
||
87 | */ |
||
88 | public function getId(): int |
||
92 | |||
93 | /** |
||
94 | * Set name |
||
95 | * |
||
96 | * @param string $name |
||
97 | * |
||
98 | * @return Poll |
||
99 | */ |
||
100 | public function setName(string $name) |
||
106 | |||
107 | /** |
||
108 | * Get name |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getName(): string |
||
116 | |||
117 | /** |
||
118 | * Set start |
||
119 | * |
||
120 | * @param \DateTime $start |
||
121 | * |
||
122 | * @return Poll |
||
123 | */ |
||
124 | public function setStart(\DateTimeInterface $start) |
||
130 | |||
131 | /** |
||
132 | * Get start |
||
133 | * |
||
134 | * @return \DateTime |
||
135 | */ |
||
136 | public function getStart(): DateTime |
||
140 | |||
141 | /** |
||
142 | * Set description |
||
143 | * |
||
144 | * @param string $description |
||
145 | * |
||
146 | * @return Poll |
||
147 | */ |
||
148 | public function setDescription(string $description) |
||
154 | |||
155 | /** |
||
156 | * Get description |
||
157 | * |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getDescription(): string |
||
164 | |||
165 | /** |
||
166 | * Set creator |
||
167 | * |
||
168 | * @param \AppBundle\Entity\User $creator |
||
169 | * |
||
170 | * @return Poll |
||
171 | */ |
||
172 | public function setCreator(User $creator = null) |
||
178 | |||
179 | /** |
||
180 | * Get creator |
||
181 | * |
||
182 | * @return \AppBundle\Entity\User |
||
183 | */ |
||
184 | public function getCreator(): User |
||
188 | |||
189 | /** |
||
190 | * Add vote |
||
191 | * |
||
192 | * @param \AppBundle\Entity\Vote $vote |
||
193 | * |
||
194 | * @return Poll |
||
195 | */ |
||
196 | public function addVote(Vote $vote) |
||
202 | |||
203 | /** |
||
204 | * Remove vote |
||
205 | * |
||
206 | * @param \AppBundle\Entity\Vote $vote |
||
207 | */ |
||
208 | public function removeVote(Vote $vote) |
||
212 | |||
213 | /** |
||
214 | * Get votes |
||
215 | * |
||
216 | * @return \Doctrine\Common\Collections\Collection |
||
217 | */ |
||
218 | public function getVotes() |
||
222 | |||
223 | /** |
||
224 | * Add choice |
||
225 | * |
||
226 | * @param \AppBundle\Entity\Choice $choice |
||
227 | * |
||
228 | * @return Poll |
||
229 | */ |
||
230 | public function addChoice(Choice $choice) |
||
236 | |||
237 | /** |
||
238 | * Remove choice |
||
239 | * |
||
240 | * @param \AppBundle\Entity\Choice $choice |
||
241 | */ |
||
242 | public function removeChoice(Choice $choice) |
||
246 | |||
247 | /** |
||
248 | * Get choices |
||
249 | * |
||
250 | * @return \Doctrine\Common\Collections\Collection |
||
251 | */ |
||
252 | public function getChoices() |
||
256 | } |
||
257 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.