1 | <?php |
||
15 | class Choice |
||
16 | { |
||
17 | /** |
||
18 | * @var int |
||
19 | * |
||
20 | * @ORM\Column(name="id", type="integer") |
||
21 | * @ORM\Id |
||
22 | * @ORM\GeneratedValue(strategy="AUTO") |
||
23 | */ |
||
24 | private $id; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | * |
||
29 | * @ORM\Column(name="choice_name", type="string", length=255) |
||
30 | */ |
||
31 | private $choiceName; |
||
32 | |||
33 | /** |
||
34 | * @ORM\OneToMany(targetEntity="Vote", mappedBy="choice") |
||
35 | */ |
||
36 | private $votes; |
||
37 | |||
38 | /** |
||
39 | * Constructor |
||
40 | */ |
||
41 | public function __construct() |
||
45 | |||
46 | /** |
||
47 | * Get id |
||
48 | * |
||
49 | * @return integer |
||
50 | */ |
||
51 | public function getId(): int |
||
55 | |||
56 | /** |
||
57 | * Set choiceName |
||
58 | * |
||
59 | * @param string $choiceName |
||
60 | * |
||
61 | * @return Choice |
||
62 | */ |
||
63 | public function setChoiceName(string $choiceName) |
||
69 | |||
70 | /** |
||
71 | * Get choiceName |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getChoiceName(): string |
||
79 | |||
80 | /** |
||
81 | * Add vote |
||
82 | * |
||
83 | * @param \AppBundle\Entity\Vote $vote |
||
84 | * |
||
85 | * @return Choice |
||
86 | */ |
||
87 | public function addVote(Vote $vote) |
||
93 | |||
94 | /** |
||
95 | * Remove vote |
||
96 | * |
||
97 | * @param \AppBundle\Entity\Vote $vote |
||
98 | */ |
||
99 | public function removeVote(Vote $vote) |
||
103 | |||
104 | /** |
||
105 | * Get votes |
||
106 | * |
||
107 | * @return \Doctrine\Common\Collections\Collection |
||
108 | */ |
||
109 | public function getVotes() |
||
113 | } |
||
114 |