friends = new ArrayCollection(); $this->configNotifications = new ArrayCollection(); $this->notifications = new ArrayCollection(); $this->ownedWishes = new ArrayCollection(); $this->participations = new ArrayCollection(); $this->comments = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } /** * A visual identifier that represents this user. * * @see UserInterface */ public function getUsername(): string { return (string) $this->email; } /** * @see UserInterface */ public function getRoles(): array { $roles = $this->roles; // guarantee every user at least has ROLE_USER $roles[] = 'ROLE_USER'; return array_unique($roles); } public function setRoles(array $roles): self { $this->roles = $roles; return $this; } /** * @see UserInterface */ public function getPassword(): string { return (string) $this->password; } public function setPassword(string $password): self { $this->password = $password; return $this; } /** * @see UserInterface */ public function getSalt() { // not needed when using the "bcrypt" algorithm in security.yaml } /** * @see UserInterface */ public function eraseCredentials() { // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } public function getName (): ?string { return $this->name; } public function setName (string $name): self { $this->name = $name; return $this; } public function getFistname (): ?string { return $this->fist_name; } public function setFistname (?string $fist_name): self { $this->fist_name = $fist_name; return $this; } public function getGender (): ?int { return $this->gender; } public function setGender (int $gender): self { $this->gender = $gender; return $this; } public function getAvatar (): ?string { return $this->avatar; } public function setAvatar (?string $avatar): self { $this->avatar = $avatar; return $this; } public function getLanguage (): ?Language { return $this->language; } public function setLanguage (?Language $language): self { $this->language = $language; return $this; } /** * @return Collection|self[] */ public function getFriends (): Collection { return $this->friends; } public function addFriend (self $friend): self { if (!$this->friends->contains($friend)) { $this->friends[] = $friend; } return $this; } public function removeFriend (self $friend): self { if ($this->friends->contains($friend)) { $this->friends->removeElement($friend); } return $this; } /** * @return Collection|ConfigNotification[] */ public function getConfigNotifications (): Collection { return $this->configNotifications; } public function addConfigNotification (ConfigNotification $configNotification): self { if (!$this->configNotifications->contains($configNotification)) { $this->configNotifications[] = $configNotification; $configNotification->setUser($this); } return $this; } public function removeConfigNotification (ConfigNotification $configNotification): self { if ($this->configNotifications->contains($configNotification)) { $this->configNotifications->removeElement($configNotification); // set the owning side to null (unless already changed) if ($configNotification->getUser() === $this) { $configNotification->setUser(null); } } return $this; } /** * @return Collection|UserNotification[] */ public function getNotifications (): Collection { return $this->notifications; } public function addNotification (UserNotification $notification): self { if (!$this->notifications->contains($notification)) { $this->notifications[] = $notification; $notification->setUser($this); } return $this; } public function removeNotification (UserNotification $notification): self { if ($this->notifications->contains($notification)) { $this->notifications->removeElement($notification); // set the owning side to null (unless already changed) if ($notification->getUser() === $this) { $notification->setUser(null); } } return $this; } /** * @return Collection|Wish[] */ public function getOwnedWishes(): Collection { return $this->ownedWishes; } public function addOwnedWish(Wish $ownedWish): self { if (!$this->ownedWishes->contains($ownedWish)) { $this->ownedWishes[] = $ownedWish; $ownedWish->setOwner($this); } return $this; } public function removeOwnedWish(Wish $ownedWish): self { if ($this->ownedWishes->contains($ownedWish)) { $this->ownedWishes->removeElement($ownedWish); // set the owning side to null (unless already changed) if ($ownedWish->getOwner() === $this) { $ownedWish->setOwner(null); } } return $this; } /** * @return Collection|Participant[] */ public function getParticipations(): Collection { return $this->participations; } public function addParticipation(Participant $participation): self { if (!$this->participations->contains($participation)) { $this->participations[] = $participation; $participation->setUser($this); } return $this; } public function removeParticipation(Participant $participation): self { if ($this->participations->contains($participation)) { $this->participations->removeElement($participation); // set the owning side to null (unless already changed) if ($participation->getUser() === $this) { $participation->setUser(null); } } return $this; } /** * @return Collection|Comment[] */ public function getComments(): Collection { return $this->comments; } public function addComment(Comment $comment): self { if (!$this->comments->contains($comment)) { $this->comments[] = $comment; $comment->setUser($this); } return $this; } public function removeComment(Comment $comment): self { if ($this->comments->contains($comment)) { $this->comments->removeElement($comment); // set the owning side to null (unless already changed) if ($comment->getUser() === $this) { $comment->setUser(null); } } return $this; } }