1 | <?php |
||
32 | class Participant extends Entity |
||
33 | { |
||
34 | /** |
||
35 | * @ORM\Id |
||
36 | * @ORM\Column(type="integer") |
||
37 | * @ORM\GeneratedValue(strategy="AUTO") |
||
38 | */ |
||
39 | private $id; |
||
40 | |||
41 | /** |
||
42 | * @ORM\Column(type="string", length=100) |
||
43 | * @Assert\NotBlank() |
||
44 | */ |
||
45 | private $name; |
||
46 | |||
47 | /** |
||
48 | * @var integer |
||
49 | * |
||
50 | * @ORM\Column(name="priority", type="integer") |
||
51 | */ |
||
52 | private $priority = 0; |
||
53 | |||
54 | |||
55 | /** |
||
56 | * @ORM\OneToMany(targetEntity="Participation", mappedBy="participant", cascade={"remove"}) |
||
57 | */ |
||
58 | private $participations; |
||
59 | |||
60 | /** |
||
61 | * @ORM\ManyToOne(targetEntity="Poll", inversedBy="participants") |
||
62 | */ |
||
63 | private $poll; |
||
64 | |||
65 | public function __construct() |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function __toString() |
||
77 | |||
78 | /** |
||
79 | * Get id |
||
80 | * |
||
81 | * @return integer |
||
82 | */ |
||
83 | public function getId() |
||
87 | |||
88 | /** |
||
89 | * Set name |
||
90 | * |
||
91 | * @param string $name |
||
92 | * @return Participant |
||
93 | */ |
||
94 | public function setName($name) |
||
100 | |||
101 | /** |
||
102 | * Get name |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getName() |
||
110 | |||
111 | /** |
||
112 | * @return mixed |
||
113 | */ |
||
114 | public function getPriority() |
||
118 | |||
119 | /** |
||
120 | * @param mixed $priority |
||
121 | */ |
||
122 | public function setPriority($priority) |
||
126 | |||
127 | /** |
||
128 | * Add participations |
||
129 | * |
||
130 | * @param \Abienvenu\KyelaBundle\Entity\Participation $participations |
||
131 | * @return Participant |
||
132 | */ |
||
133 | public function addParticipation(Participation $participations) |
||
139 | |||
140 | /** |
||
141 | * Remove participations |
||
142 | * |
||
143 | * @param Participation $participations |
||
144 | */ |
||
145 | public function removeParticipation(Participation $participations) |
||
149 | |||
150 | /** |
||
151 | * Get participations |
||
152 | * |
||
153 | * @return \Doctrine\Common\Collections\Collection |
||
154 | */ |
||
155 | public function getParticipations() |
||
159 | |||
160 | /** |
||
161 | * Set poll |
||
162 | * |
||
163 | * @param Poll $poll |
||
164 | * @return Participant |
||
165 | */ |
||
166 | public function setPoll(Poll $poll = null) |
||
172 | |||
173 | /** |
||
174 | * Get poll |
||
175 | * |
||
176 | * @return Poll |
||
177 | */ |
||
178 | public function getPoll() |
||
182 | } |
||
183 |