<?php
namespace App\Entity;
use App\Repository\UserRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Serializable;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Entity(repositoryClass=UserRepository::class)
* @ORM\Table(name="`user`")
* @Serializer\ExclusionPolicy("ALL")
*/
#[UniqueEntity(fields: ['email'], message: 'message="Ce compte existe déjà')]
class User implements UserInterface, PasswordAuthenticatedUserInterface, Serializable
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Expose
* @Serializer\Groups({"user_profile", "edit_profile", "testimony", "ligth_list", "edit_visitor_profile", "live_details"})
*/
private $id;
/**
* @ORM\Column(type="string", length=180, unique=true)
* @Serializer\Expose
* @Serializer\Groups({"user_profile", "edit_profile", "testimony", "ligth_list", "edit_visitor_profile", "live_details"})
*/
private $email;
/**
* @ORM\Column(type="json")
*/
private $roles = [];
/**
* @var string The hashed password
* @ORM\Column(type="string", nullable=true)
*/
private $password;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $lastLoginAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $lastLogoutAt;
/**
* @ORM\OneToMany(targetEntity=UserOffice::class, mappedBy="user", cascade={"persist", "remove"})
*/
private $userOffices;
/**
* @ORM\Column(type="text", nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"user_profile"})
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"user_profile", "edit_profile", "testimony", "historic", "ligth_list", "edit_visitor_profile", "live_details"})
*/
private $lastname;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"user_profile", "edit_profile", "testimony", "historic", "ligth_list", "edit_visitor_profile", "live_details"})
*/
private $firstname;
/**
* @ORM\OneToMany(targetEntity=Experience::class, mappedBy="user", cascade={"persist", "remove"})
* @Serializer\Expose
* @Serializer\Groups({"user_profile"})
*/
private $userExperiences;
/**
* @ORM\OneToMany(targetEntity=Course::class, mappedBy="publishedBy")
*/
private $courses;
/**
* @ORM\ManyToMany(targetEntity=Role::class, mappedBy="users")
*/
private $userRoles;
/**
* @ORM\OneToMany(targetEntity=Enrollment::class, mappedBy="user")
*/
private $enrollments;
/**
* @ORM\ManyToOne(targetEntity=Country::class, inversedBy="users")
* @Serializer\Expose
* @Serializer\Groups({"edit_visitor_profile"})
*/
private $country;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Expose
*/
private $isFirstConnexion = true;
/**
* @ORM\OneToMany(targetEntity=ModuleView::class, mappedBy="createdBy")
*/
private $moduleViews;
/**
* @ORM\OneToMany(targetEntity=ModuleLike::class, mappedBy="user")
*/
private $moduleLikes;
/**
* @ORM\OneToMany(targetEntity=Module::class, mappedBy="publishedBy")
*/
private $modulePublishers;
/**
* @ORM\ManyToOne(targetEntity=Module::class, inversedBy="coaches")
*/
private $module;
/**
* @ORM\OneToMany(targetEntity=UserQuizQuestion::class, mappedBy="user")
*/
private $userQuizQuestions;
/**
* @ORM\OneToMany(targetEntity=Quote::class, mappedBy="publishedBy")
*/
private $quotes;
/**
* @ORM\OneToMany(targetEntity=Director::class, mappedBy="publishedBy")
*/
private $directors;
/**
* @ORM\ManyToMany(targetEntity=Module::class, mappedBy="coaches")
*/
private $modules;
/**
* @ORM\ManyToMany(targetEntity=Live::class, mappedBy="coaches")
*/
private $lives;
/**
* @ORM\OneToMany(targetEntity=LiveParticipant::class, mappedBy="participant")
*/
private $liveParticipants;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $registrationNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hierarchicalLevel;
/**
* @ORM\OneToMany(targetEntity=ModuleComment::class, mappedBy="user")
*/
private $moduleComments;
/**
* @ORM\ManyToOne(targetEntity=SubsidiaryCompany::class, inversedBy="users")
* @Serializer\Expose
* @Serializer\Groups({"user_profile"})
*/
private $subsidiaryCompany;
/**
* @ORM\ManyToOne(targetEntity=Job::class, inversedBy="users")
*/
private $job;
/**
* @ORM\ManyToOne(targetEntity=Office::class, inversedBy="users")
* @Serializer\Expose
* @Serializer\Groups({"user_profile"})
*/
private $office;
/**
* @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="users")
*/
private $contract;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"user_profile", "edit_profile", "testimony", "live_details"})
*/
private $phoneNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $status;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $active = true;
/**
* @ORM\OneToOne(targetEntity=ImageManager::class, cascade={"persist", "remove"})
* @Serializer\Expose
* @Serializer\Groups({"user_profile", "live_details"})
*/
private $photo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $referent;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"user_profile"})
*/
private $entryDate;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="responsibles")
*/
private $responsible;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="responsible")
*/
private $responsibles;
/**
* @ORM\OneToMany(targetEntity=ProgramParticipation::class, mappedBy="createdBy")
*/
private $programParticipations;
/**
* @ORM\OneToMany(targetEntity=ModuleParticipation::class, mappedBy="createdBy")
*/
private $moduleParticipations;
/**
* @ORM\OneToMany(targetEntity=ModuleInscription::class, mappedBy="user")
*/
private $moduleInscriptions;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $activationCode;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $activationCodeExpiredAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $resetCode;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $resetCodeExpiredAt;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $deviceTokens = [];
/**
* @ORM\OneToMany(targetEntity=Discussion::class, mappedBy="createdBy")
*/
private $senderDiscussions;
/**
* @ORM\OneToMany(targetEntity=Discussion::class, mappedBy="receiver")
*/
private $receiverDiscussions;
/**
* @ORM\OneToMany(targetEntity=Message::class, mappedBy="createdBy")
*/
private $messages;
/**
* @ORM\Column(type="boolean")
*/
private $isVerified = true;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profileColor;
/**
* @ORM\ManyToMany(targetEntity=Program::class, mappedBy="users")
*/
private $programs;
/**
* @ORM\OneToMany(targetEntity=UserModuleParticipation::class, mappedBy="createdBy")
*/
private $userModuleParticipations;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isInternalAccount = false;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $elapsedTime;
/**
* @ORM\OneToMany(targetEntity=Notification::class, mappedBy="receiver")
*/
private $notifications;
/**
* @ORM\OneToMany(targetEntity=NotificationReceiver::class, mappedBy="receiver")
*/
private $notificationReceivers;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $lastLoginNotifiedAt;
public function __construct()
{
$this->userOffices = new ArrayCollection();
$this->userExperiences = new ArrayCollection();
$this->courses = new ArrayCollection();
$this->userRoles = new ArrayCollection();
$this->enrollments = new ArrayCollection();
$this->moduleViews = new ArrayCollection();
$this->moduleLikes = new ArrayCollection();
$this->modulePublishers = new ArrayCollection();
$this->userQuizQuestions = new ArrayCollection();
$this->quotes = new ArrayCollection();
$this->directors = new ArrayCollection();
$this->modules = new ArrayCollection();
$this->lives = new ArrayCollection();
$this->liveParticipants = new ArrayCollection();
$this->moduleComments = new ArrayCollection();
$this->responsibles = new ArrayCollection();
$this->programParticipations = new ArrayCollection();
$this->moduleParticipations = new ArrayCollection();
$this->moduleInscriptions = new ArrayCollection();
$this->senderDiscussions = new ArrayCollection();
$this->receiverDiscussions = new ArrayCollection();
$this->messages = new ArrayCollection();
$this->programs = new ArrayCollection();
$this->userModuleParticipations = new ArrayCollection();
$this->notifications = new ArrayCollection();
$this->notificationReceivers = 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 getUserIdentifier(): string
{
return (string) $this->email;
}
/**
* @deprecated since Symfony 5.3, use getUserIdentifier instead
*/
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 PasswordAuthenticatedUserInterface
*/
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(?string $password): self
{
$this->password = $password;
return $this;
}
/**
* Returning a salt is only needed, if you are not using a modern
* hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
*
* @see UserInterface
*/
public function getSalt(): ?string
{
return null;
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function getLastLoginAt(): ?\DateTimeInterface
{
return $this->lastLoginAt;
}
public function setLastLoginAt(?\DateTimeInterface $lastLoginAt): self
{
$this->lastLoginAt = $lastLoginAt;
return $this;
}
public function getLastLogoutAt(): ?\DateTimeInterface
{
return $this->lastLogoutAt;
}
public function setLastLogoutAt(?\DateTimeInterface $lastLogoutAt): self
{
$this->lastLogoutAt = $lastLogoutAt;
return $this;
}
/**
* @return Collection<int, UserOffice>
*/
public function getUserOffices(): Collection
{
return $this->userOffices;
}
public function addUserOffice(UserOffice $userOffice): self
{
if (!$this->userOffices->contains($userOffice)) {
$this->userOffices[] = $userOffice;
$userOffice->setUser($this);
}
return $this;
}
public function removeUserOffice(UserOffice $userOffice): self
{
if ($this->userOffices->removeElement($userOffice)) {
// set the owning side to null (unless already changed)
if ($userOffice->getUser() === $this) {
$userOffice->setUser(null);
}
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(?string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(?string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
public function getFullname(): ?string
{
return $this->getFirstname().' '.$this->getLastname();
}
/**
* @return Collection<int, Experience>
*/
public function getUserExperiences(): Collection
{
return $this->userExperiences;
}
public function addUserExperience(Experience $userExperience): self
{
if (!$this->userExperiences->contains($userExperience)) {
$this->userExperiences[] = $userExperience;
$userExperience->setUser($this);
}
return $this;
}
public function removeUserExperience(Experience $userExperience): self
{
if ($this->userExperiences->removeElement($userExperience)) {
// set the owning side to null (unless already changed)
if ($userExperience->getUser() === $this) {
$userExperience->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Course>
*/
public function getCourses(): Collection
{
return $this->courses;
}
public function addCourse(Course $course): self
{
if (!$this->courses->contains($course)) {
$this->courses[] = $course;
$course->setPublishedBy($this);
}
return $this;
}
public function removeCourse(Course $course): self
{
if ($this->courses->removeElement($course)) {
// set the owning side to null (unless already changed)
if ($course->getPublishedBy() === $this) {
$course->setPublishedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, Role>
*/
public function getUserRoles(): Collection
{
return $this->userRoles;
}
public function addUserRole(Role $userRole): self
{
if (!$this->userRoles->contains($userRole)) {
$this->userRoles[] = $userRole;
$userRole->addUser($this);
}
return $this;
}
public function removeUserRole(Role $userRole): self
{
if ($this->userRoles->removeElement($userRole)) {
$userRole->removeUser($this);
}
return $this;
}
/**
* @return Collection<int, Enrollment>
*/
public function getEnrollments(): Collection
{
return $this->enrollments;
}
public function addEnrollment(Enrollment $enrollment): self
{
if (!$this->enrollments->contains($enrollment)) {
$this->enrollments[] = $enrollment;
$enrollment->setUser($this);
}
return $this;
}
public function removeEnrollment(Enrollment $enrollment): self
{
if ($this->enrollments->removeElement($enrollment)) {
// set the owning side to null (unless already changed)
if ($enrollment->getUser() === $this) {
$enrollment->setUser(null);
}
}
return $this;
}
public function getCountry(): ?Country
{
return $this->country;
}
public function setCountry(?Country $country): self
{
$this->country = $country;
return $this;
}
public function isIsFirstConnexion(): ?bool
{
return $this->isFirstConnexion;
}
public function setIsFirstConnexion(?bool $isFirstConnexion): self
{
$this->isFirstConnexion = $isFirstConnexion;
return $this;
}
/**
* @return Collection<int, ModuleView>
*/
public function getModuleViews(): Collection
{
return $this->moduleViews;
}
public function addModuleView(ModuleView $moduleView): self
{
if (!$this->moduleViews->contains($moduleView)) {
$this->moduleViews[] = $moduleView;
$moduleView->setCreatedBy($this);
}
return $this;
}
public function removeModuleView(ModuleView $moduleView): self
{
if ($this->moduleViews->removeElement($moduleView)) {
// set the owning side to null (unless already changed)
if ($moduleView->getCreatedBy() === $this) {
$moduleView->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, ModuleLike>
*/
public function getModuleLikes(): Collection
{
return $this->moduleLikes;
}
public function addModuleLike(ModuleLike $moduleLike): self
{
if (!$this->moduleLikes->contains($moduleLike)) {
$this->moduleLikes[] = $moduleLike;
$moduleLike->setUser($this);
}
return $this;
}
public function removeModuleLike(ModuleLike $moduleLike): self
{
if ($this->moduleLikes->removeElement($moduleLike)) {
// set the owning side to null (unless already changed)
if ($moduleLike->getUser() === $this) {
$moduleLike->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Module>
*/
public function getModulePublishers(): Collection
{
return $this->modulePublishers;
}
public function addModulePublisher(Module $modulePublisher): self
{
if (!$this->modulePublishers->contains($modulePublisher)) {
$this->modulePublishers[] = $modulePublisher;
$modulePublisher->setPublishedBy($this);
}
return $this;
}
public function removeModulePublisher(Module $modulePublisher): self
{
if ($this->modulePublishers->removeElement($modulePublisher)) {
// set the owning side to null (unless already changed)
if ($modulePublisher->getPublishedBy() === $this) {
$modulePublisher->setPublishedBy(null);
}
}
return $this;
}
public function getModule(): ?Module
{
return $this->module;
}
public function setModule(?Module $module): self
{
$this->module = $module;
return $this;
}
/**
* @return Collection<int, UserQuizQuestion>
*/
public function getUserQuizQuestions(): Collection
{
return $this->userQuizQuestions;
}
public function addUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
{
if (!$this->userQuizQuestions->contains($userQuizQuestion)) {
$this->userQuizQuestions[] = $userQuizQuestion;
$userQuizQuestion->setCreatedBy($this);
}
return $this;
}
public function removeUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
{
if ($this->userQuizQuestions->removeElement($userQuizQuestion)) {
// set the owning side to null (unless already changed)
if ($userQuizQuestion->getCreatedBy() === $this) {
$userQuizQuestion->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, Quote>
*/
public function getQuotes(): Collection
{
return $this->quotes;
}
public function addQuote(Quote $quote): self
{
if (!$this->quotes->contains($quote)) {
$this->quotes[] = $quote;
$quote->setPublishedBy($this);
}
return $this;
}
public function removeQuote(Quote $quote): self
{
if ($this->quotes->removeElement($quote)) {
// set the owning side to null (unless already changed)
if ($quote->getPublishedBy() === $this) {
$quote->setPublishedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, Director>
*/
public function getDirectors(): Collection
{
return $this->directors;
}
public function addDirector(Director $director): self
{
if (!$this->directors->contains($director)) {
$this->directors[] = $director;
$director->setPublishedBy($this);
}
return $this;
}
public function removeDirector(Director $director): self
{
if ($this->directors->removeElement($director)) {
// set the owning side to null (unless already changed)
if ($director->getPublishedBy() === $this) {
$director->setPublishedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, Module>
*/
public function getModules(): Collection
{
return $this->modules;
}
public function addModule(Module $module): self
{
if (!$this->modules->contains($module)) {
$this->modules[] = $module;
$module->addCoach($this);
}
return $this;
}
public function removeModule(Module $module): self
{
if ($this->modules->removeElement($module)) {
$module->removeCoach($this);
}
return $this;
}
/**
* @return Collection<int, Live>
*/
public function getLives(): Collection
{
return $this->lives;
}
public function addLife(Live $life): self
{
if (!$this->lives->contains($life)) {
$this->lives[] = $life;
$life->addCoach($this);
}
return $this;
}
public function removeLife(Live $life): self
{
if ($this->lives->removeElement($life)) {
$life->removeCoach($this);
}
return $this;
}
/**
* @return Collection<int, LiveParticipant>
*/
public function getLiveParticipants(): Collection
{
return $this->liveParticipants;
}
public function addLiveParticipant(LiveParticipant $liveParticipant): self
{
if (!$this->liveParticipants->contains($liveParticipant)) {
$this->liveParticipants[] = $liveParticipant;
$liveParticipant->setParticipant($this);
}
return $this;
}
public function removeLiveParticipant(LiveParticipant $liveParticipant): self
{
if ($this->liveParticipants->removeElement($liveParticipant)) {
// set the owning side to null (unless already changed)
if ($liveParticipant->getParticipant() === $this) {
$liveParticipant->setParticipant(null);
}
}
return $this;
}
public function getRegistrationNumber(): ?string
{
return $this->registrationNumber;
}
public function setRegistrationNumber(?string $registrationNumber): self
{
$this->registrationNumber = $registrationNumber;
return $this;
}
public function getHierarchicalLevel(): ?string
{
return $this->hierarchicalLevel;
}
public function setHierarchicalLevel(?string $hierarchicalLevel): self
{
$this->hierarchicalLevel = $hierarchicalLevel;
return $this;
}
/**
* @return Collection<int, ModuleComment>
*/
public function getModuleComments(): Collection
{
return $this->moduleComments;
}
public function addModuleComment(ModuleComment $moduleComment): self
{
if (!$this->moduleComments->contains($moduleComment)) {
$this->moduleComments[] = $moduleComment;
$moduleComment->setUser($this);
}
return $this;
}
public function removeModuleComment(ModuleComment $moduleComment): self
{
if ($this->moduleComments->removeElement($moduleComment)) {
// set the owning side to null (unless already changed)
if ($moduleComment->getUser() === $this) {
$moduleComment->setUser(null);
}
}
return $this;
}
public function getSubsidiaryCompany(): ?SubsidiaryCompany
{
return $this->subsidiaryCompany;
}
public function setSubsidiaryCompany(?SubsidiaryCompany $subsidiaryCompany): self
{
$this->subsidiaryCompany = $subsidiaryCompany;
return $this;
}
public function getJob(): ?Job
{
return $this->job;
}
public function setJob(?Job $job): self
{
$this->job = $job;
return $this;
}
public function getOffice(): ?Office
{
return $this->office;
}
public function setOffice(?Office $office): self
{
$this->office = $office;
return $this;
}
public function getContract(): ?Contract
{
return $this->contract;
}
public function setContract(?Contract $contract): self
{
$this->contract = $contract;
return $this;
}
public function getPhoneNumber(): ?string
{
return $this->phoneNumber;
}
public function setPhoneNumber(?string $phoneNumber): self
{
$this->phoneNumber = $phoneNumber;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): self
{
$this->active = $active;
return $this;
}
public function getPhoto(): ?ImageManager
{
return $this->photo;
}
public function setPhoto(?ImageManager $photo): self
{
$this->photo = $photo;
return $this;
}
public function getReferent(): ?string
{
return $this->referent;
}
public function setReferent(?string $referent): self
{
$this->referent = $referent;
return $this;
}
public function getEntryDate(): ?\DateTimeInterface
{
return $this->entryDate;
}
public function setEntryDate(?\DateTimeInterface $entryDate): self
{
$this->entryDate = $entryDate;
return $this;
}
public function getResponsible(): ?self
{
return $this->responsible;
}
public function setResponsible(?self $responsible): self
{
$this->responsible = $responsible;
return $this;
}
/**
* @return Collection<int, self>
*/
public function getResponsibles(): Collection
{
return $this->responsibles;
}
public function addResponsible(self $responsible): self
{
if (!$this->responsibles->contains($responsible)) {
$this->responsibles[] = $responsible;
$responsible->setResponsible($this);
}
return $this;
}
public function removeResponsible(self $responsible): self
{
if ($this->responsibles->removeElement($responsible)) {
// set the owning side to null (unless already changed)
if ($responsible->getResponsible() === $this) {
$responsible->setResponsible(null);
}
}
return $this;
}
/**
* @return Collection<int, ProgramParticipation>
*/
public function getProgramParticipations(): Collection
{
return $this->programParticipations;
}
public function addProgramParticipation(ProgramParticipation $programParticipation): self
{
if (!$this->programParticipations->contains($programParticipation)) {
$this->programParticipations[] = $programParticipation;
$programParticipation->setCreatedBy($this);
}
return $this;
}
public function removeProgramParticipation(ProgramParticipation $programParticipation): self
{
if ($this->programParticipations->removeElement($programParticipation)) {
// set the owning side to null (unless already changed)
if ($programParticipation->getCreatedBy() === $this) {
$programParticipation->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, ModuleParticipation>
*/
public function getModuleParticipations(): Collection
{
return $this->moduleParticipations;
}
public function addModuleParticipation(ModuleParticipation $moduleParticipation): self
{
if (!$this->moduleParticipations->contains($moduleParticipation)) {
$this->moduleParticipations[] = $moduleParticipation;
$moduleParticipation->setCreatedBy($this);
}
return $this;
}
public function removeModuleParticipation(ModuleParticipation $moduleParticipation): self
{
if ($this->moduleParticipations->removeElement($moduleParticipation)) {
// set the owning side to null (unless already changed)
if ($moduleParticipation->getCreatedBy() === $this) {
$moduleParticipation->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, ModuleInscription>
*/
public function getModuleInscriptions(): Collection
{
return $this->moduleInscriptions;
}
public function addModuleInscription(ModuleInscription $moduleInscription): self
{
if (!$this->moduleInscriptions->contains($moduleInscription)) {
$this->moduleInscriptions[] = $moduleInscription;
$moduleInscription->setUser($this);
}
return $this;
}
public function removeModuleInscription(ModuleInscription $moduleInscription): self
{
if ($this->moduleInscriptions->removeElement($moduleInscription)) {
// set the owning side to null (unless already changed)
if ($moduleInscription->getUser() === $this) {
$moduleInscription->setUser(null);
}
}
return $this;
}
/** @see \Serializable::serialize() */
public function serialize()
{
return serialize(array(
$this->id,
$this->email,
$this->password,
// see section on salt below
// $this->salt,
));
}
/** @see \Serializable::serialize() */
public function __serialize()
{
return array(
$this->id,
$this->email,
$this->password,
// see section on salt below
// $this->salt,
);
}
/** @see \Serializable::unserialize() */
public function unserialize($serialized)
{
list (
$this->id,
$this->email,
$this->password,
// see section on salt below
// $this->salt
) = unserialize($serialized);
}
/** @see \Serializable::unserialize() */
public function __unserialize($serialized)
{
list (
$this->id,
$this->email,
$this->password,
// see section on salt below
// $this->salt
) = unserialize(serialize($serialized));
}
public function getActivationCode(): ?string
{
return $this->activationCode;
}
public function setActivationCode(?string $activationCode): self
{
$this->activationCode = $activationCode;
return $this;
}
public function getActivationCodeExpiredAt(): ?\DateTimeInterface
{
return $this->activationCodeExpiredAt;
}
public function setActivationCodeExpiredAt(?\DateTimeInterface $activationCodeExpiredAt): self
{
$this->activationCodeExpiredAt = $activationCodeExpiredAt;
return $this;
}
public function getResetCode(): ?string
{
return $this->resetCode;
}
public function setResetCode(?string $resetCode): self
{
$this->resetCode = $resetCode;
return $this;
}
public function getResetCodeExpiredAt(): ?\DateTimeInterface
{
return $this->resetCodeExpiredAt;
}
public function setResetCodeExpiredAt(?\DateTimeInterface $resetCodeExpiredAt): self
{
$this->resetCodeExpiredAt = $resetCodeExpiredAt;
return $this;
}
public function getDeviceTokens(): ?array
{
return $this->deviceTokens;
}
public function setDeviceTokens(?array $deviceTokens): self
{
$this->deviceTokens = $deviceTokens;
return $this;
}
/**
* @return Collection<int, Discussion>
*/
public function getSenderDiscussions(): Collection
{
return $this->senderDiscussions;
}
public function addSenderDiscussion(Discussion $senderDiscussion): self
{
if (!$this->senderDiscussions->contains($senderDiscussion)) {
$this->senderDiscussions[] = $senderDiscussion;
$senderDiscussion->setCreatedBy($this);
}
return $this;
}
public function removeSenderDiscussion(Discussion $senderDiscussion): self
{
if ($this->senderDiscussions->removeElement($senderDiscussion)) {
// set the owning side to null (unless already changed)
if ($senderDiscussion->getCreatedBy() === $this) {
$senderDiscussion->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, Discussion>
*/
public function getReceiverDiscussions(): Collection
{
return $this->receiverDiscussions;
}
public function addReceiverDiscussion(Discussion $receiverDiscussion): self
{
if (!$this->receiverDiscussions->contains($receiverDiscussion)) {
$this->receiverDiscussions[] = $receiverDiscussion;
$receiverDiscussion->setCreatedBy($this);
}
return $this;
}
public function removeReceiverDiscussion(Discussion $receiverDiscussion): self
{
if ($this->receiverDiscussions->removeElement($receiverDiscussion)) {
// set the owning side to null (unless already changed)
if ($receiverDiscussion->getCreatedBy() === $this) {
$receiverDiscussion->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, Message>
*/
public function getMessages(): Collection
{
return $this->messages;
}
public function addMessage(Message $message): self
{
if (!$this->messages->contains($message)) {
$this->messages[] = $message;
$message->setReceiver($this);
}
return $this;
}
public function removeMessage(Message $message): self
{
if ($this->messages->removeElement($message)) {
// set the owning side to null (unless already changed)
if ($message->getReceiver() === $this) {
$message->setReceiver(null);
}
}
return $this;
}
public function isVerified(): bool
{
return $this->isVerified;
}
public function setIsVerified(bool $isVerified): self
{
$this->isVerified = $isVerified;
return $this;
}
public function getProfileColor(): ?string
{
return $this->profileColor;
}
public function setProfileColor(?string $profileColor): self
{
$this->profileColor = $profileColor;
return $this;
}
/**
* @return Collection<int, Program>
*/
public function getPrograms(): Collection
{
return $this->programs;
}
public function addProgram(Program $program): self
{
if (!$this->programs->contains($program)) {
$this->programs[] = $program;
$program->addUser($this);
}
return $this;
}
public function removeProgram(Program $program): self
{
if ($this->programs->removeElement($program)) {
$program->removeUser($this);
}
return $this;
}
/**
* @return Collection<int, UserModuleParticipation>
*/
public function getUserModuleParticipations(): Collection
{
return $this->userModuleParticipations;
}
public function addUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
{
if (!$this->userModuleParticipations->contains($userModuleParticipation)) {
$this->userModuleParticipations[] = $userModuleParticipation;
$userModuleParticipation->setParticipant($this);
}
return $this;
}
public function removeUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
{
if ($this->userModuleParticipations->removeElement($userModuleParticipation)) {
// set the owning side to null (unless already changed)
if ($userModuleParticipation->getParticipant() === $this) {
$userModuleParticipation->setParticipant(null);
}
}
return $this;
}
public function isIsInternalAccount(): ?bool
{
return $this->isInternalAccount;
}
public function setIsInternalAccount(?bool $isInternalAccount): self
{
$this->isInternalAccount = $isInternalAccount;
return $this;
}
public function getElapsedTime(): ?int
{
return $this->elapsedTime;
}
public function setElapsedTime(?int $elapsedTime): self
{
$this->elapsedTime = $elapsedTime;
return $this;
}
/**
* @return Collection<int, Notification>
*/
public function getNotifications(): Collection
{
return $this->notifications;
}
public function addNotification(Notification $notification): self
{
if (!$this->notifications->contains($notification)) {
$this->notifications[] = $notification;
$notification->setReceiver($this);
}
return $this;
}
public function removeNotification(Notification $notification): self
{
if ($this->notifications->removeElement($notification)) {
// set the owning side to null (unless already changed)
if ($notification->getReceiver() === $this) {
$notification->setReceiver(null);
}
}
return $this;
}
/**
* @return Collection<int, NotificationReceiver>
*/
public function getNotificationReceivers(): Collection
{
return $this->notificationReceivers;
}
public function addNotificationReceiver(NotificationReceiver $notificationReceiver): self
{
if (!$this->notificationReceivers->contains($notificationReceiver)) {
$this->notificationReceivers[] = $notificationReceiver;
$notificationReceiver->setReceiver($this);
}
return $this;
}
public function removeNotificationReceiver(NotificationReceiver $notificationReceiver): self
{
if ($this->notificationReceivers->removeElement($notificationReceiver)) {
// set the owning side to null (unless already changed)
if ($notificationReceiver->getReceiver() === $this) {
$notificationReceiver->setReceiver(null);
}
}
return $this;
}
public function getLastLoginNotifiedAt(): ?\DateTimeInterface
{
return $this->lastLoginNotifiedAt;
}
public function setLastLoginNotifiedAt(?\DateTimeInterface $lastLoginNotifiedAt): self
{
$this->lastLoginNotifiedAt = $lastLoginNotifiedAt;
return $this;
}
}