1 | <?php |
||
15 | class User extends BaseUser |
||
16 | { |
||
17 | /** |
||
18 | * @ORM\Id |
||
19 | * @ORM\Column(type="integer") |
||
20 | * @ORM\GeneratedValue(strategy="AUTO") |
||
21 | */ |
||
22 | protected $id; |
||
23 | |||
24 | /** |
||
25 | * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Group") |
||
26 | * @ORM\JoinTable(name="fos_user_user_group", |
||
27 | * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, |
||
28 | * inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")} |
||
29 | * ) |
||
30 | */ |
||
31 | protected $groups; |
||
32 | |||
33 | /** |
||
34 | * @ORM\OneToMany(targetEntity="Poll", mappedBy="creator") |
||
35 | */ |
||
36 | private $createdPolls; |
||
37 | |||
38 | /** |
||
39 | * @ORM\Column(type="string") |
||
40 | */ |
||
41 | protected $name; |
||
42 | |||
43 | /** |
||
44 | * @ORM\OneToMany(targetEntity="Vote", mappedBy="caster") |
||
45 | */ |
||
46 | private $votes; |
||
47 | |||
48 | /** |
||
49 | * Constructor |
||
50 | */ |
||
51 | public function __construct() |
||
58 | |||
59 | /** |
||
60 | * Set name |
||
61 | * |
||
62 | * @param string $name |
||
63 | * |
||
64 | * @return Poll |
||
65 | */ |
||
66 | public function setName(string $name) |
||
72 | |||
73 | /** |
||
74 | * Get name |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getName(): string |
||
82 | |||
83 | /** |
||
84 | * Add createdPoll |
||
85 | * |
||
86 | * @param \AppBundle\Entity\Poll $createdPoll |
||
87 | * |
||
88 | * @return User |
||
89 | */ |
||
90 | public function addCreatedPoll(Poll $createdPoll) |
||
96 | |||
97 | /** |
||
98 | * Remove createdPoll |
||
99 | * |
||
100 | * @param \AppBundle\Entity\Poll $createdPoll |
||
101 | */ |
||
102 | public function removeCreatedPoll(Poll $createdPoll) |
||
106 | |||
107 | /** |
||
108 | * Get createdPolls |
||
109 | * |
||
110 | * @return \Doctrine\Common\Collections\Collection |
||
111 | */ |
||
112 | public function getCreatedPolls() |
||
116 | |||
117 | /** |
||
118 | * Add vote |
||
119 | * |
||
120 | * @param \AppBundle\Entity\Vote $vote |
||
121 | * |
||
122 | * @return User |
||
123 | */ |
||
124 | public function addVote(Vote $vote) |
||
130 | |||
131 | /** |
||
132 | * Remove vote |
||
133 | * |
||
134 | * @param \AppBundle\Entity\Vote $vote |
||
135 | */ |
||
136 | public function removeVote(Vote $vote) |
||
140 | |||
141 | /** |
||
142 | * Get votes |
||
143 | * |
||
144 | * @return \Doctrine\Common\Collections\Collection |
||
145 | */ |
||
146 | public function getVotes() |
||
150 | } |
||
151 |