1 <?php
declare(strict_types
=1);
4 * this file is part of the rapsys packbundle package.
6 * (c) raphaël gertz <symfony@rapsys.eu>
8 * for the full copyright and license information, please view the license
9 * file that was distributed with this source code.
12 namespace Rapsys\AirBundle\Entity
;
14 use Doctrine\Common\Collections\ArrayCollection
;
16 use Rapsys\AirBundle\Entity\Application
;
17 use Rapsys\AirBundle\Entity\Group
;
18 use Rapsys\AirBundle\Entity\Link
;
19 use Rapsys\AirBundle\Entity\Snippet
;
20 use Rapsys\UserBundle\Entity\User
as BaseUser
;
22 class User
extends BaseUser
{
39 * @var ArrayCollection
41 private $applications;
44 * @var ArrayCollection
49 * @var ArrayCollection
54 * @var ArrayCollection
59 * @var ArrayCollection
64 * @var ArrayCollection
66 private $subscriptions;
71 * @param string $mail The user mail
73 public function __construct(string $mail) {
74 //Call parent constructor
75 parent
::__construct($mail);
78 $this->pseudonym
= null;
83 $this->applications
= new ArrayCollection();
84 $this->dances
= new ArrayCollection();
85 $this->locations
= new ArrayCollection();
86 $this->snippets
= new ArrayCollection();
87 $this->subscribers
= new ArrayCollection();
88 $this->subscriptions
= new ArrayCollection();
94 * @param string $pseudonym
98 public function setPseudonym(?string $pseudonym): User
{
99 $this->pseudonym
= $pseudonym;
109 public function getPseudonym(): ?string {
110 return $this->pseudonym
;
116 * @param string $phone
120 public function setPhone(?string $phone): User
{
121 $this->phone
= $phone;
131 public function getPhone(): ?string {
138 * @param string $slug
142 public function setSlug(?string $slug): User
{
153 public function getSlug(): ?string {
160 * @param Application $application
164 public function addApplication(Application
$application): User
{
165 $this->applications
[] = $application;
173 * @param Application $application
175 public function removeApplication(Application
$application): bool {
176 return $this->applications
->removeElement($application);
182 * @return ArrayCollection
184 public function getApplications(): ArrayCollection
{
185 return $this->applications
;
191 * @param Snippet $snippet
195 public function addSnippet(Snippet
$snippet): User
{
196 $this->snippets
[] = $snippet;
204 * @param Snippet $snippet
206 public function removeSnippet(Snippet
$snippet): bool {
207 return $this->snippets
->removeElement($snippet);
213 * @return ArrayCollection
215 public function getSnippets(): ArrayCollection
{
216 return $this->snippets
;
222 * @param Dance $dance
226 public function addDance(Dance
$dance): User
{
227 $this->dances
[] = $dance;
235 * @param Dance $dance
239 public function removeDance(Dance
$dance): bool {
240 return $this->dances
->removeElement($dance);
246 * @return ArrayCollection
248 public function getDances(): ArrayCollection
{
249 return $this->dances
;
255 * @param Location $location
259 public function addLocation(Location
$location): User
{
260 $this->locations
[] = $location;
268 * @param Location $location
270 public function removeLocation(Location
$location): bool {
271 return $this->locations
->removeElement($location);
277 * @return ArrayCollection
279 public function getLocations(): ArrayCollection
{
280 return $this->locations
;
286 * @param User $subscriber
290 public function addSubscriber(User
$subscriber): User
{
291 $this->subscribers
[] = $subscriber;
299 * @param User $subscriber
301 public function removeSubscriber(User
$subscriber): bool {
302 return $this->subscribers
->removeElement($subscriber);
308 * @return ArrayCollection
310 public function getSubscribers(): ArrayCollection
{
311 return $this->subscribers
;
317 * @param User $subscription
321 public function addSubscription(User
$subscription): User
{
322 $this->subscriptions
[] = $subscription;
328 * Remove subscription
330 * @param User $subscription
332 public function removeSubscription(User
$subscription): bool {
333 return $this->subscriptions
->removeElement($subscription);
339 * @return ArrayCollection
341 public function getSubscriptions(): ArrayCollection
{
342 return $this->subscriptions
;