1 | <?php |
||
34 | class Choice extends Entity |
||
35 | { |
||
36 | public function __toString() |
||
40 | |||
41 | /** |
||
42 | * @var integer |
||
43 | * |
||
44 | * @ORM\Column(name="id", type="integer") |
||
45 | * @ORM\Id |
||
46 | * @ORM\GeneratedValue(strategy="AUTO") |
||
47 | */ |
||
48 | private $id; |
||
49 | |||
50 | /** |
||
51 | * @var string |
||
52 | * |
||
53 | * @ORM\Column(name="name", type="string", length=64) |
||
54 | * @Assert\NotBlank() |
||
55 | */ |
||
56 | private $name; |
||
57 | |||
58 | /** |
||
59 | * @var integer |
||
60 | * |
||
61 | * @ORM\Column(name="value", type="integer") |
||
62 | */ |
||
63 | private $value; |
||
64 | |||
65 | /** |
||
66 | * @var string |
||
67 | * |
||
68 | * @ORM\Column(name="color", type="string", length=16) |
||
69 | */ |
||
70 | private $color; |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | * |
||
75 | * @ORM\Column(name="icon", type="string", length=16, nullable=true) |
||
76 | */ |
||
77 | private $icon; |
||
78 | |||
79 | /** |
||
80 | * @var integer |
||
81 | * |
||
82 | * @ORM\Column(name="priority", type="integer") |
||
83 | */ |
||
84 | private $priority; |
||
85 | |||
86 | /** |
||
87 | * @ORM\OneToMany(targetEntity="Participation", mappedBy="choice", cascade={"remove"}) |
||
88 | */ |
||
89 | private $participations; |
||
90 | |||
91 | /** |
||
92 | * @ORM\ManyToOne(targetEntity="Poll", inversedBy="choices") |
||
93 | */ |
||
94 | private $poll; |
||
95 | |||
96 | /** |
||
97 | * Get id |
||
98 | * |
||
99 | * @return integer |
||
100 | */ |
||
101 | public function getId() |
||
105 | |||
106 | /** |
||
107 | * Set name |
||
108 | * |
||
109 | * @param string $name |
||
110 | * @return Choice |
||
111 | */ |
||
112 | public function setName($name) |
||
118 | |||
119 | /** |
||
120 | * Get name |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | public function getName() |
||
128 | |||
129 | /** |
||
130 | * Set value |
||
131 | * |
||
132 | * @param integer $value |
||
133 | * @return Choice |
||
134 | */ |
||
135 | public function setValue($value) |
||
141 | |||
142 | /** |
||
143 | * Get value |
||
144 | * |
||
145 | * @return integer |
||
146 | */ |
||
147 | public function getValue() |
||
151 | |||
152 | /** |
||
153 | * Set color |
||
154 | * |
||
155 | * @param string $color |
||
156 | * @return Choice |
||
157 | */ |
||
158 | public function setColor($color) |
||
164 | |||
165 | /** |
||
166 | * Get color |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getColor() |
||
174 | /** |
||
175 | * Constructor |
||
176 | */ |
||
177 | public function __construct() |
||
181 | |||
182 | /** |
||
183 | * Add participations |
||
184 | * |
||
185 | * @param Participation $participations |
||
186 | * @return Choice |
||
187 | */ |
||
188 | public function addParticipation(Participation $participations) |
||
194 | |||
195 | /** |
||
196 | * Remove participations |
||
197 | * |
||
198 | * @param Participation $participations |
||
199 | */ |
||
200 | public function removeParticipation(Participation $participations) |
||
204 | |||
205 | /** |
||
206 | * Get participations |
||
207 | * |
||
208 | * @return \Doctrine\Common\Collections\Collection |
||
209 | */ |
||
210 | public function getParticipations() |
||
214 | |||
215 | /** |
||
216 | * Set poll |
||
217 | * |
||
218 | * @param Poll $poll |
||
219 | * @return Choice |
||
220 | */ |
||
221 | public function setPoll(Poll $poll = null) |
||
227 | |||
228 | /** |
||
229 | * Get poll |
||
230 | * |
||
231 | * @return Poll |
||
232 | */ |
||
233 | public function getPoll() |
||
237 | |||
238 | /** |
||
239 | * Set priority |
||
240 | * |
||
241 | * @param integer $priority |
||
242 | * @return Choice |
||
243 | */ |
||
244 | public function setPriority($priority) |
||
250 | |||
251 | /** |
||
252 | * Get priority |
||
253 | * |
||
254 | * @return integer |
||
255 | */ |
||
256 | public function getPriority() |
||
260 | |||
261 | /** |
||
262 | * Set icon |
||
263 | * |
||
264 | * @param string $icon |
||
265 | * @return Choice |
||
266 | */ |
||
267 | public function setIcon($icon) |
||
273 | |||
274 | /** |
||
275 | * Get icon |
||
276 | * |
||
277 | * @return string |
||
278 | */ |
||
279 | public function getIcon() |
||
283 | } |
||
284 |