src/Entity/User.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Serializable;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  10. use Symfony\Component\Security\Core\User\UserInterface;
  11. use JMS\Serializer\Annotation as Serializer;
  12. /**
  13.  * @ORM\Entity(repositoryClass=UserRepository::class)
  14.  * @ORM\Table(name="`user`")
  15.  * @Serializer\ExclusionPolicy("ALL")
  16.  */
  17. #[UniqueEntity(fields: ['email'], message'message="Ce compte existe déjà')]
  18. class User implements UserInterfacePasswordAuthenticatedUserInterfaceSerializable
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue
  23.      * @ORM\Column(type="integer")
  24.      * @Serializer\Expose
  25.      * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "ligth_list", "edit_visitor_profile", "live_details"})
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string", length=180, unique=true)
  30.      * @Serializer\Expose
  31.      * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "ligth_list", "edit_visitor_profile", "live_details"})
  32.      */
  33.     private $email;
  34.     /**
  35.      * @ORM\Column(type="json")
  36.      */
  37.     private $roles = [];
  38.     /**
  39.      * @var string The hashed password
  40.      * @ORM\Column(type="string", nullable=true)
  41.      */
  42.     private $password;
  43.     /**
  44.      * @ORM\Column(type="datetime", nullable=true)
  45.      */
  46.     private $lastLoginAt;
  47.     /**
  48.      * @ORM\Column(type="datetime", nullable=true)
  49.      */
  50.     private $lastLogoutAt;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=UserOffice::class, mappedBy="user", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  53.      */
  54.     private $userOffices;
  55.     /**
  56.      * @ORM\Column(type="text", nullable=true)
  57.      * @Serializer\Expose
  58.      * @Serializer\Groups({"user_profile"})
  59.      */
  60.     private $description;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      * @Serializer\Expose
  64.      * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "historic", "ligth_list", "edit_visitor_profile", "live_details"})
  65.      */
  66.     private $lastname;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      * @Serializer\Expose
  70.      * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "historic", "ligth_list", "edit_visitor_profile", "live_details"})
  71.      */
  72.     private $firstname;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity=Experience::class, mappedBy="user", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  75.      * @Serializer\Expose
  76.      * @Serializer\Groups({"user_profile"})
  77.      */
  78.     private $userExperiences;
  79.     /**
  80.      * @ORM\OneToMany(targetEntity=Course::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  81.      */
  82.     private $courses;
  83.     /**
  84.      * @ORM\ManyToMany(targetEntity=Role::class, mappedBy="users")
  85.      */
  86.     private $userRoles;
  87.     /**
  88.      * @ORM\OneToMany(targetEntity=Enrollment::class, mappedBy="user", fetch="EXTRA_LAZY")
  89.      */
  90.     private $enrollments;
  91.     /**
  92.      * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="users")
  93.      * @Serializer\Expose
  94.      * @Serializer\Groups({"edit_visitor_profile"})
  95.      */
  96.     private $country;
  97.     /**
  98.      * @ORM\Column(type="boolean", nullable=true)
  99.      * @Serializer\Expose
  100.      */
  101.     private $isFirstConnexion true;
  102.     /**
  103.      * @ORM\OneToMany(targetEntity=ModuleView::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  104.      */
  105.     private $moduleViews;
  106.     /**
  107.      * @ORM\OneToMany(targetEntity=ModuleLike::class, mappedBy="user", fetch="EXTRA_LAZY")
  108.      */
  109.     private $moduleLikes;
  110.     /**
  111.      * @ORM\OneToMany(targetEntity=Module::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  112.      */
  113.     private $modulePublishers;
  114.     /**
  115.      * @ORM\OneToMany(targetEntity=UserQuizQuestion::class, mappedBy="user", fetch="EXTRA_LAZY")
  116.      */
  117.     private $userQuizQuestions;
  118.     /**
  119.      * @ORM\OneToMany(targetEntity=Quote::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  120.      */
  121.     private $quotes;
  122.     /**
  123.      * @ORM\OneToMany(targetEntity=Director::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  124.      */
  125.     private $directors;
  126.     /**
  127.      * @ORM\ManyToMany(targetEntity=Module::class, mappedBy="coaches")
  128.      */
  129.     private $modules;
  130.     /**
  131.      * @ORM\ManyToMany(targetEntity=Live::class, mappedBy="coaches")
  132.      */
  133.     private $lives;
  134.     /**
  135.      * @ORM\OneToMany(targetEntity=LiveParticipant::class, mappedBy="participant", fetch="EXTRA_LAZY")
  136.      */
  137.     private $liveParticipants;
  138.     /**
  139.      * @ORM\Column(type="string", length=255, nullable=true)
  140.      */
  141.     private $registrationNumber;
  142.     /**
  143.      * @ORM\Column(type="string", length=255, nullable=true)
  144.      */
  145.     private $hierarchicalLevel;
  146.     /**
  147.      * @ORM\OneToMany(targetEntity=ModuleComment::class, mappedBy="user", fetch="EXTRA_LAZY")
  148.      */
  149.     private $moduleComments;
  150.     /**
  151.      * @ORM\ManyToOne(targetEntity=SubsidiaryCompany::class, inversedBy="users")
  152.      * @Serializer\Expose
  153.      * @Serializer\Groups({"user_profile"})
  154.      */
  155.     private $subsidiaryCompany;
  156.     /**
  157.      * @ORM\ManyToOne(targetEntity=Job::class, inversedBy="users")
  158.      */
  159.     private $job;
  160.     /**
  161.      * @ORM\ManyToOne(targetEntity=Office::class, inversedBy="users")
  162.      * @Serializer\Expose
  163.      * @Serializer\Groups({"user_profile"})
  164.      */
  165.     private $office;
  166.     /**
  167.      * @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="users")
  168.      */
  169.     private $contract;
  170.     /**
  171.      * @ORM\Column(type="string", length=255, nullable=true)
  172.      * @Serializer\Expose
  173.      * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "live_details"})
  174.      */
  175.     private $phoneNumber;
  176.     /**
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      */
  179.     private $status;
  180.     /**
  181.      * @ORM\Column(type="boolean", nullable=true)
  182.      */
  183.     private $active true;
  184.     /**
  185.      * @ORM\OneToOne(targetEntity=ImageManager::class, cascade={"persist", "remove"})
  186.      * @Serializer\Expose
  187.      * @Serializer\Groups({"user_profile", "live_details"})
  188.      */
  189.     private $photo;
  190.     /**
  191.      * @ORM\Column(type="string", length=255, nullable=true)
  192.      */
  193.     private $referent;
  194.     /**
  195.      * @ORM\Column(type="datetime", nullable=true)
  196.      * @Serializer\Expose
  197.      * @Serializer\Groups({"user_profile"})
  198.      */
  199.     private $entryDate;
  200.     /**
  201.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="responsibles")
  202.      */
  203.     private $responsible;
  204.     /**
  205.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="responsible", fetch="EXTRA_LAZY")
  206.      */
  207.     private $responsibles;
  208.     /**
  209.      * @ORM\OneToMany(targetEntity=ProgramParticipation::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  210.      */
  211.     private $programParticipations;
  212.     /**
  213.      * @ORM\OneToMany(targetEntity=ModuleParticipation::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  214.      */
  215.     private $moduleParticipations;
  216.     /**
  217.      * @ORM\OneToMany(targetEntity=ModuleInscription::class, mappedBy="user", fetch="EXTRA_LAZY")
  218.      */
  219.     private $moduleInscriptions;
  220.     /**
  221.      * @ORM\Column(type="string", length=255, nullable=true)
  222.      */
  223.     private $activationCode;
  224.     /**
  225.      * @ORM\Column(type="datetime", nullable=true)
  226.      */
  227.     private $activationCodeExpiredAt;
  228.     /**
  229.      * @ORM\Column(type="string", length=255, nullable=true)
  230.      */
  231.     private $resetCode;
  232.     /**
  233.      * @ORM\Column(type="datetime", nullable=true)
  234.      */
  235.     private $resetCodeExpiredAt;
  236.     /**
  237.      * @ORM\Column(type="array", nullable=true)
  238.      */
  239.     private $deviceTokens = [];
  240.     /**
  241.      * @ORM\OneToMany(targetEntity=Discussion::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  242.      */
  243.     private $senderDiscussions;
  244.      /**
  245.      * @ORM\OneToMany(targetEntity=Discussion::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  246.      */
  247.     private $receiverDiscussions;
  248.     /**
  249.      * @ORM\OneToMany(targetEntity=Message::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  250.      */
  251.     private $messages;
  252.     /**
  253.      * @ORM\Column(type="boolean")
  254.      */
  255.     private $isVerified true;
  256.     /**
  257.      * @ORM\Column(type="string", length=255, nullable=true)
  258.      */
  259.     private $profileColor;
  260.     /**
  261.      * @ORM\ManyToMany(targetEntity=Program::class, mappedBy="users")
  262.      */
  263.     private $programs;
  264.     /**
  265.      * @ORM\OneToMany(targetEntity=UserModuleParticipation::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  266.      */
  267.     private $userModuleParticipations;
  268.     /**
  269.      * @ORM\Column(type="boolean", nullable=true)
  270.      */
  271.     private $isInternalAccount false;
  272.     /**
  273.      * @ORM\Column(type="integer", nullable=true)
  274.      */
  275.     private $elapsedTime;
  276.     /**
  277.      * @ORM\OneToMany(targetEntity=Notification::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  278.      */
  279.     private $notifications;
  280.     /**
  281.      * @ORM\OneToMany(targetEntity=NotificationReceiver::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  282.      */
  283.     private $notificationReceivers;
  284.     /**
  285.      * @ORM\Column(type="datetime", nullable=true)
  286.      */
  287.     private $lastLoginNotifiedAt;
  288.     /**
  289.      * @ORM\OneToMany(targetEntity=Message::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  290.      */
  291.     private $receiverMessages;
  292.     public function __construct()
  293.     {
  294.         $this->userOffices = new ArrayCollection();
  295.         $this->userExperiences = new ArrayCollection();
  296.         $this->courses = new ArrayCollection();
  297.         $this->userRoles = new ArrayCollection();
  298.         $this->enrollments = new ArrayCollection();
  299.         $this->moduleViews = new ArrayCollection();
  300.         $this->moduleLikes = new ArrayCollection();
  301.         $this->modulePublishers = new ArrayCollection();
  302.         $this->userQuizQuestions = new ArrayCollection();
  303.         $this->quotes = new ArrayCollection();
  304.         $this->directors = new ArrayCollection();
  305.         $this->modules = new ArrayCollection();
  306.         $this->lives = new ArrayCollection();
  307.         $this->liveParticipants = new ArrayCollection();
  308.         $this->moduleComments = new ArrayCollection();
  309.         $this->responsibles = new ArrayCollection();
  310.         $this->programParticipations = new ArrayCollection();
  311.         $this->moduleParticipations = new ArrayCollection();
  312.         $this->moduleInscriptions = new ArrayCollection();
  313.         $this->senderDiscussions = new ArrayCollection();
  314.         $this->receiverDiscussions = new ArrayCollection();
  315.         $this->messages = new ArrayCollection();
  316.         $this->programs = new ArrayCollection();
  317.         $this->userModuleParticipations = new ArrayCollection();
  318.         $this->notifications = new ArrayCollection();
  319.         $this->notificationReceivers = new ArrayCollection();
  320.         $this->receiverMessages = new ArrayCollection();
  321.     }
  322.     public function getId(): ?int
  323.     {
  324.         return $this->id;
  325.     }
  326.     public function getEmail(): ?string
  327.     {
  328.         return $this->email;
  329.     }
  330.     public function setEmail(string $email): self
  331.     {
  332.         $this->email $email;
  333.         return $this;
  334.     }
  335.     /**
  336.      * A visual identifier that represents this user.
  337.      *
  338.      * @see UserInterface
  339.      */
  340.     public function getUserIdentifier(): string
  341.     {
  342.         return (string) $this->email;
  343.     }
  344.     /**
  345.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  346.      */
  347.     public function getUsername(): string
  348.     {
  349.         return (string) $this->email;
  350.     }
  351.     /**
  352.      * @see UserInterface
  353.      */
  354.     public function getRoles(): array
  355.     {
  356.         $roles $this->roles;
  357.         // guarantee every user at least has ROLE_USER
  358.         $roles[] = 'ROLE_USER';
  359.         return array_unique($roles);
  360.     }
  361.     public function setRoles(array $roles): self
  362.     {
  363.         $this->roles $roles;
  364.         return $this;
  365.     }
  366.     /**
  367.      * @see PasswordAuthenticatedUserInterface
  368.      */
  369.     public function getPassword(): ?string
  370.     {
  371.         return $this->password;
  372.     }
  373.     public function setPassword(?string $password): self
  374.     {
  375.         $this->password $password;
  376.         return $this;
  377.     }
  378.     /**
  379.      * Returning a salt is only needed, if you are not using a modern
  380.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  381.      *
  382.      * @see UserInterface
  383.      */
  384.     public function getSalt(): ?string
  385.     {
  386.         return null;
  387.     }
  388.     /**
  389.      * @see UserInterface
  390.      */
  391.     public function eraseCredentials()
  392.     {
  393.         // If you store any temporary, sensitive data on the user, clear it here
  394.         // $this->plainPassword = null;
  395.     }
  396.     public function getLastLoginAt(): ?\DateTimeInterface
  397.     {
  398.         return $this->lastLoginAt;
  399.     }
  400.     public function setLastLoginAt(?\DateTimeInterface $lastLoginAt): self
  401.     {
  402.         $this->lastLoginAt $lastLoginAt;
  403.         return $this;
  404.     }
  405.     public function getLastLogoutAt(): ?\DateTimeInterface
  406.     {
  407.         return $this->lastLogoutAt;
  408.     }
  409.     public function setLastLogoutAt(?\DateTimeInterface $lastLogoutAt): self
  410.     {
  411.         $this->lastLogoutAt $lastLogoutAt;
  412.         return $this;
  413.     }
  414.     /**
  415.      * @return Collection<int, UserOffice>
  416.      */
  417.     public function getUserOffices(): Collection
  418.     {
  419.         return $this->userOffices;
  420.     }
  421.     public function addUserOffice(UserOffice $userOffice): self
  422.     {
  423.         if (!$this->userOffices->contains($userOffice)) {
  424.             $this->userOffices[] = $userOffice;
  425.             $userOffice->setUser($this);
  426.         }
  427.         return $this;
  428.     }
  429.     public function removeUserOffice(UserOffice $userOffice): self
  430.     {
  431.         if ($this->userOffices->removeElement($userOffice)) {
  432.             // set the owning side to null (unless already changed)
  433.             if ($userOffice->getUser() === $this) {
  434.                 $userOffice->setUser(null);
  435.             }
  436.         }
  437.         return $this;
  438.     }
  439.     public function getDescription(): ?string
  440.     {
  441.         return $this->description;
  442.     }
  443.     public function setDescription(?string $description): self
  444.     {
  445.         $this->description $description;
  446.         return $this;
  447.     }
  448.     public function getLastname(): ?string
  449.     {
  450.         return $this->lastname;
  451.     }
  452.     public function setLastname(?string $lastname): self
  453.     {
  454.         $this->lastname $lastname;
  455.         return $this;
  456.     }
  457.     public function getFirstname(): ?string
  458.     {
  459.         return $this->firstname;
  460.     }
  461.     public function setFirstname(?string $firstname): self
  462.     {
  463.         $this->firstname $firstname;
  464.         return $this;
  465.     }
  466.     public function getFullname(): ?string
  467.     {
  468.         return $this->getFirstname().' '.$this->getLastname();
  469.     }
  470.     /**
  471.      * @return Collection<int, Experience>
  472.      */
  473.     public function getUserExperiences(): Collection
  474.     {
  475.         return $this->userExperiences;
  476.     }
  477.     public function addUserExperience(Experience $userExperience): self
  478.     {
  479.         if (!$this->userExperiences->contains($userExperience)) {
  480.             $this->userExperiences[] = $userExperience;
  481.             $userExperience->setUser($this);
  482.         }
  483.         return $this;
  484.     }
  485.     public function removeUserExperience(Experience $userExperience): self
  486.     {
  487.         if ($this->userExperiences->removeElement($userExperience)) {
  488.             // set the owning side to null (unless already changed)
  489.             if ($userExperience->getUser() === $this) {
  490.                 $userExperience->setUser(null);
  491.             }
  492.         }
  493.         return $this;
  494.     }
  495.     /**
  496.      * @return Collection<int, Course>
  497.      */
  498.     public function getCourses(): Collection
  499.     {
  500.         return $this->courses;
  501.     }
  502.     public function addCourse(Course $course): self
  503.     {
  504.         if (!$this->courses->contains($course)) {
  505.             $this->courses[] = $course;
  506.             $course->setPublishedBy($this);
  507.         }
  508.         return $this;
  509.     }
  510.     public function removeCourse(Course $course): self
  511.     {
  512.         if ($this->courses->removeElement($course)) {
  513.             // set the owning side to null (unless already changed)
  514.             if ($course->getPublishedBy() === $this) {
  515.                 $course->setPublishedBy(null);
  516.             }
  517.         }
  518.         return $this;
  519.     }
  520.     /**
  521.      * @return Collection<int, Role>
  522.      */
  523.     public function getUserRoles(): Collection
  524.     {
  525.         return $this->userRoles;
  526.     }
  527.     public function addUserRole(Role $userRole): self
  528.     {
  529.         if (!$this->userRoles->contains($userRole)) {
  530.             $this->userRoles[] = $userRole;
  531.             $userRole->addUser($this);
  532.         }
  533.         return $this;
  534.     }
  535.     public function removeUserRole(Role $userRole): self
  536.     {
  537.         if ($this->userRoles->removeElement($userRole)) {
  538.             $userRole->removeUser($this);
  539.         }
  540.         return $this;
  541.     }
  542.     /**
  543.      * @return Collection<int, Enrollment>
  544.      */
  545.     public function getEnrollments(): Collection
  546.     {
  547.         return $this->enrollments;
  548.     }
  549.     public function addEnrollment(Enrollment $enrollment): self
  550.     {
  551.         if (!$this->enrollments->contains($enrollment)) {
  552.             $this->enrollments[] = $enrollment;
  553.             $enrollment->setUser($this);
  554.         }
  555.         return $this;
  556.     }
  557.     public function removeEnrollment(Enrollment $enrollment): self
  558.     {
  559.         if ($this->enrollments->removeElement($enrollment)) {
  560.             // set the owning side to null (unless already changed)
  561.             if ($enrollment->getUser() === $this) {
  562.                 $enrollment->setUser(null);
  563.             }
  564.         }
  565.         return $this;
  566.     }
  567.     public function getCountry(): ?Country
  568.     {
  569.         return $this->country;
  570.     }
  571.     public function setCountry(?Country $country): self
  572.     {
  573.         $this->country $country;
  574.         return $this;
  575.     }
  576.     public function isIsFirstConnexion(): ?bool
  577.     {
  578.         return $this->isFirstConnexion;
  579.     }
  580.     public function setIsFirstConnexion(?bool $isFirstConnexion): self
  581.     {
  582.         $this->isFirstConnexion $isFirstConnexion;
  583.         return $this;
  584.     }
  585.     /**
  586.      * @return Collection<int, ModuleView>
  587.      */
  588.     public function getModuleViews(): Collection
  589.     {
  590.         return $this->moduleViews;
  591.     }
  592.     public function addModuleView(ModuleView $moduleView): self
  593.     {
  594.         if (!$this->moduleViews->contains($moduleView)) {
  595.             $this->moduleViews[] = $moduleView;
  596.             $moduleView->setCreatedBy($this);
  597.         }
  598.         return $this;
  599.     }
  600.     public function removeModuleView(ModuleView $moduleView): self
  601.     {
  602.         if ($this->moduleViews->removeElement($moduleView)) {
  603.             // set the owning side to null (unless already changed)
  604.             if ($moduleView->getCreatedBy() === $this) {
  605.                 $moduleView->setCreatedBy(null);
  606.             }
  607.         }
  608.         return $this;
  609.     }
  610.     /**
  611.      * @return Collection<int, ModuleLike>
  612.      */
  613.     public function getModuleLikes(): Collection
  614.     {
  615.         return $this->moduleLikes;
  616.     }
  617.     public function addModuleLike(ModuleLike $moduleLike): self
  618.     {
  619.         if (!$this->moduleLikes->contains($moduleLike)) {
  620.             $this->moduleLikes[] = $moduleLike;
  621.             $moduleLike->setUser($this);
  622.         }
  623.         return $this;
  624.     }
  625.     public function removeModuleLike(ModuleLike $moduleLike): self
  626.     {
  627.         if ($this->moduleLikes->removeElement($moduleLike)) {
  628.             // set the owning side to null (unless already changed)
  629.             if ($moduleLike->getUser() === $this) {
  630.                 $moduleLike->setUser(null);
  631.             }
  632.         }
  633.         return $this;
  634.     }
  635.     /**
  636.      * @return Collection<int, Module>
  637.      */
  638.     public function getModulePublishers(): Collection
  639.     {
  640.         return $this->modulePublishers;
  641.     }
  642.     public function addModulePublisher(Module $modulePublisher): self
  643.     {
  644.         if (!$this->modulePublishers->contains($modulePublisher)) {
  645.             $this->modulePublishers[] = $modulePublisher;
  646.             $modulePublisher->setPublishedBy($this);
  647.         }
  648.         return $this;
  649.     }
  650.     public function removeModulePublisher(Module $modulePublisher): self
  651.     {
  652.         if ($this->modulePublishers->removeElement($modulePublisher)) {
  653.             // set the owning side to null (unless already changed)
  654.             if ($modulePublisher->getPublishedBy() === $this) {
  655.                 $modulePublisher->setPublishedBy(null);
  656.             }
  657.         }
  658.         return $this;
  659.     }
  660.     /**
  661.      * @return Collection<int, UserQuizQuestion>
  662.      */
  663.     public function getUserQuizQuestions(): Collection
  664.     {
  665.         return $this->userQuizQuestions;
  666.     }
  667.     public function addUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  668.     {
  669.         if (!$this->userQuizQuestions->contains($userQuizQuestion)) {
  670.             $this->userQuizQuestions[] = $userQuizQuestion;
  671.             $userQuizQuestion->setCreatedBy($this);
  672.         }
  673.         return $this;
  674.     }
  675.     public function removeUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  676.     {
  677.         if ($this->userQuizQuestions->removeElement($userQuizQuestion)) {
  678.             // set the owning side to null (unless already changed)
  679.             if ($userQuizQuestion->getCreatedBy() === $this) {
  680.                 $userQuizQuestion->setCreatedBy(null);
  681.             }
  682.         }
  683.         return $this;
  684.     }
  685.     /**
  686.      * @return Collection<int, Quote>
  687.      */
  688.     public function getQuotes(): Collection
  689.     {
  690.         return $this->quotes;
  691.     }
  692.     public function addQuote(Quote $quote): self
  693.     {
  694.         if (!$this->quotes->contains($quote)) {
  695.             $this->quotes[] = $quote;
  696.             $quote->setPublishedBy($this);
  697.         }
  698.         return $this;
  699.     }
  700.     public function removeQuote(Quote $quote): self
  701.     {
  702.         if ($this->quotes->removeElement($quote)) {
  703.             // set the owning side to null (unless already changed)
  704.             if ($quote->getPublishedBy() === $this) {
  705.                 $quote->setPublishedBy(null);
  706.             }
  707.         }
  708.         return $this;
  709.     }
  710.     /**
  711.      * @return Collection<int, Director>
  712.      */
  713.     public function getDirectors(): Collection
  714.     {
  715.         return $this->directors;
  716.     }
  717.     public function addDirector(Director $director): self
  718.     {
  719.         if (!$this->directors->contains($director)) {
  720.             $this->directors[] = $director;
  721.             $director->setPublishedBy($this);
  722.         }
  723.         return $this;
  724.     }
  725.     public function removeDirector(Director $director): self
  726.     {
  727.         if ($this->directors->removeElement($director)) {
  728.             // set the owning side to null (unless already changed)
  729.             if ($director->getPublishedBy() === $this) {
  730.                 $director->setPublishedBy(null);
  731.             }
  732.         }
  733.         return $this;
  734.     }
  735.     /**
  736.      * @return Collection<int, Module>
  737.      */
  738.     public function getModules(): Collection
  739.     {
  740.         return $this->modules;
  741.     }
  742.     public function addModule(Module $module): self
  743.     {
  744.         if (!$this->modules->contains($module)) {
  745.             $this->modules[] = $module;
  746.             $module->addCoach($this);
  747.         }
  748.         return $this;
  749.     }
  750.     public function removeModule(Module $module): self
  751.     {
  752.         if ($this->modules->removeElement($module)) {
  753.             $module->removeCoach($this);
  754.         }
  755.         return $this;
  756.     }
  757.     /**
  758.      * @return Collection<int, Live>
  759.      */
  760.     public function getLives(): Collection
  761.     {
  762.         return $this->lives;
  763.     }
  764.     public function addLife(Live $life): self
  765.     {
  766.         if (!$this->lives->contains($life)) {
  767.             $this->lives[] = $life;
  768.             $life->addCoach($this);
  769.         }
  770.         return $this;
  771.     }
  772.     public function removeLife(Live $life): self
  773.     {
  774.         if ($this->lives->removeElement($life)) {
  775.             $life->removeCoach($this);
  776.         }
  777.         return $this;
  778.     }
  779.     /**
  780.      * @return Collection<int, LiveParticipant>
  781.      */
  782.     public function getLiveParticipants(): Collection
  783.     {
  784.         return $this->liveParticipants;
  785.     }
  786.     public function addLiveParticipant(LiveParticipant $liveParticipant): self
  787.     {
  788.         if (!$this->liveParticipants->contains($liveParticipant)) {
  789.             $this->liveParticipants[] = $liveParticipant;
  790.             $liveParticipant->setParticipant($this);
  791.         }
  792.         return $this;
  793.     }
  794.     public function removeLiveParticipant(LiveParticipant $liveParticipant): self
  795.     {
  796.         if ($this->liveParticipants->removeElement($liveParticipant)) {
  797.             // set the owning side to null (unless already changed)
  798.             if ($liveParticipant->getParticipant() === $this) {
  799.                 $liveParticipant->setParticipant(null);
  800.             }
  801.         }
  802.         return $this;
  803.     }
  804.     public function getRegistrationNumber(): ?string
  805.     {
  806.         return $this->registrationNumber;
  807.     }
  808.     public function setRegistrationNumber(?string $registrationNumber): self
  809.     {
  810.         $this->registrationNumber $registrationNumber;
  811.         return $this;
  812.     }
  813.     public function getHierarchicalLevel(): ?string
  814.     {
  815.         return $this->hierarchicalLevel;
  816.     }
  817.     public function setHierarchicalLevel(?string $hierarchicalLevel): self
  818.     {
  819.         $this->hierarchicalLevel $hierarchicalLevel;
  820.         return $this;
  821.     }
  822.     /**
  823.      * @return Collection<int, ModuleComment>
  824.      */
  825.     public function getModuleComments(): Collection
  826.     {
  827.         return $this->moduleComments;
  828.     }
  829.     public function addModuleComment(ModuleComment $moduleComment): self
  830.     {
  831.         if (!$this->moduleComments->contains($moduleComment)) {
  832.             $this->moduleComments[] = $moduleComment;
  833.             $moduleComment->setUser($this);
  834.         }
  835.         return $this;
  836.     }
  837.     public function removeModuleComment(ModuleComment $moduleComment): self
  838.     {
  839.         if ($this->moduleComments->removeElement($moduleComment)) {
  840.             // set the owning side to null (unless already changed)
  841.             if ($moduleComment->getUser() === $this) {
  842.                 $moduleComment->setUser(null);
  843.             }
  844.         }
  845.         return $this;
  846.     }
  847.     public function getSubsidiaryCompany(): ?SubsidiaryCompany
  848.     {
  849.         return $this->subsidiaryCompany;
  850.     }
  851.     public function setSubsidiaryCompany(?SubsidiaryCompany $subsidiaryCompany): self
  852.     {
  853.         $this->subsidiaryCompany $subsidiaryCompany;
  854.         return $this;
  855.     }
  856.     public function getJob(): ?Job
  857.     {
  858.         return $this->job;
  859.     }
  860.     public function setJob(?Job $job): self
  861.     {
  862.         $this->job $job;
  863.         return $this;
  864.     }
  865.     public function getOffice(): ?Office
  866.     {
  867.         return $this->office;
  868.     }
  869.     public function setOffice(?Office $office): self
  870.     {
  871.         $this->office $office;
  872.         return $this;
  873.     }
  874.     public function getContract(): ?Contract
  875.     {
  876.         return $this->contract;
  877.     }
  878.     public function setContract(?Contract $contract): self
  879.     {
  880.         $this->contract $contract;
  881.         return $this;
  882.     }
  883.     public function getPhoneNumber(): ?string
  884.     {
  885.         return $this->phoneNumber;
  886.     }
  887.     public function setPhoneNumber(?string $phoneNumber): self
  888.     {
  889.         $this->phoneNumber $phoneNumber;
  890.         return $this;
  891.     }
  892.     public function getStatus(): ?string
  893.     {
  894.         return $this->status;
  895.     }
  896.     public function setStatus(?string $status): self
  897.     {
  898.         $this->status $status;
  899.         return $this;
  900.     }
  901.     public function isActive(): ?bool
  902.     {
  903.         return $this->active;
  904.     }
  905.     public function setActive(?bool $active): self
  906.     {
  907.         $this->active $active;
  908.         return $this;
  909.     }
  910.     public function getPhoto(): ?ImageManager
  911.     {
  912.         return $this->photo;
  913.     }
  914.     public function setPhoto(?ImageManager $photo): self
  915.     {
  916.         $this->photo $photo;
  917.         return $this;
  918.     }
  919.     public function getReferent(): ?string
  920.     {
  921.         return $this->referent;
  922.     }
  923.     public function setReferent(?string $referent): self
  924.     {
  925.         $this->referent $referent;
  926.         return $this;
  927.     }
  928.     public function getEntryDate(): ?\DateTimeInterface
  929.     {
  930.         return $this->entryDate;
  931.     }
  932.     public function setEntryDate(?\DateTimeInterface $entryDate): self
  933.     {
  934.         $this->entryDate $entryDate;
  935.         return $this;
  936.     }
  937.     public function getResponsible(): ?self
  938.     {
  939.         return $this->responsible;
  940.     }
  941.     public function setResponsible(?self $responsible): self
  942.     {
  943.         $this->responsible $responsible;
  944.         return $this;
  945.     }
  946.     /**
  947.      * @return Collection<int, self>
  948.      */
  949.     public function getResponsibles(): Collection
  950.     {
  951.         return $this->responsibles;
  952.     }
  953.     public function addResponsible(self $responsible): self
  954.     {
  955.         if (!$this->responsibles->contains($responsible)) {
  956.             $this->responsibles[] = $responsible;
  957.             $responsible->setResponsible($this);
  958.         }
  959.         return $this;
  960.     }
  961.     public function removeResponsible(self $responsible): self
  962.     {
  963.         if ($this->responsibles->removeElement($responsible)) {
  964.             // set the owning side to null (unless already changed)
  965.             if ($responsible->getResponsible() === $this) {
  966.                 $responsible->setResponsible(null);
  967.             }
  968.         }
  969.         return $this;
  970.     }
  971.     /**
  972.      * @return Collection<int, ProgramParticipation>
  973.      */
  974.     public function getProgramParticipations(): Collection
  975.     {
  976.         return $this->programParticipations;
  977.     }
  978.     public function addProgramParticipation(ProgramParticipation $programParticipation): self
  979.     {
  980.         if (!$this->programParticipations->contains($programParticipation)) {
  981.             $this->programParticipations[] = $programParticipation;
  982.             $programParticipation->setCreatedBy($this);
  983.         }
  984.         return $this;
  985.     }
  986.     public function removeProgramParticipation(ProgramParticipation $programParticipation): self
  987.     {
  988.         if ($this->programParticipations->removeElement($programParticipation)) {
  989.             // set the owning side to null (unless already changed)
  990.             if ($programParticipation->getCreatedBy() === $this) {
  991.                 $programParticipation->setCreatedBy(null);
  992.             }
  993.         }
  994.         return $this;
  995.     }
  996.     /**
  997.      * @return Collection<int, ModuleParticipation>
  998.      */
  999.     public function getModuleParticipations(): Collection
  1000.     {
  1001.         return $this->moduleParticipations;
  1002.     }
  1003.     public function addModuleParticipation(ModuleParticipation $moduleParticipation): self
  1004.     {
  1005.         if (!$this->moduleParticipations->contains($moduleParticipation)) {
  1006.             $this->moduleParticipations[] = $moduleParticipation;
  1007.             $moduleParticipation->setCreatedBy($this);
  1008.         }
  1009.         return $this;
  1010.     }
  1011.     public function removeModuleParticipation(ModuleParticipation $moduleParticipation): self
  1012.     {
  1013.         if ($this->moduleParticipations->removeElement($moduleParticipation)) {
  1014.             // set the owning side to null (unless already changed)
  1015.             if ($moduleParticipation->getCreatedBy() === $this) {
  1016.                 $moduleParticipation->setCreatedBy(null);
  1017.             }
  1018.         }
  1019.         return $this;
  1020.     }
  1021.     /**
  1022.      * @return Collection<int, ModuleInscription>
  1023.      */
  1024.     public function getModuleInscriptions(): Collection
  1025.     {
  1026.         return $this->moduleInscriptions;
  1027.     }
  1028.     public function addModuleInscription(ModuleInscription $moduleInscription): self
  1029.     {
  1030.         if (!$this->moduleInscriptions->contains($moduleInscription)) {
  1031.             $this->moduleInscriptions[] = $moduleInscription;
  1032.             $moduleInscription->setUser($this);
  1033.         }
  1034.         return $this;
  1035.     }
  1036.     public function removeModuleInscription(ModuleInscription $moduleInscription): self
  1037.     {
  1038.         if ($this->moduleInscriptions->removeElement($moduleInscription)) {
  1039.             // set the owning side to null (unless already changed)
  1040.             if ($moduleInscription->getUser() === $this) {
  1041.                 $moduleInscription->setUser(null);
  1042.             }
  1043.         }
  1044.         return $this;
  1045.     }
  1046.     /** @see \Serializable::serialize() */
  1047.     public function serialize()
  1048.     {
  1049.          return serialize(array(
  1050.              $this->id,
  1051.              $this->email,
  1052.              $this->password,
  1053.              // see section on salt below
  1054.              // $this->salt,
  1055.          ));
  1056.     }
  1057.     /** @see \Serializable::serialize() */
  1058.     public function __serialize()
  1059.     {
  1060.          return array(
  1061.              $this->id,
  1062.              $this->email,
  1063.              $this->password,
  1064.              // see section on salt below
  1065.              // $this->salt,
  1066.          );
  1067.     }
  1068.  
  1069.     /** @see \Serializable::unserialize() */
  1070.     public function unserialize($serialized)
  1071.     {
  1072.          list (
  1073.              $this->id,
  1074.              $this->email,
  1075.              $this->password,
  1076.              // see section on salt below
  1077.              // $this->salt
  1078.          ) = unserialize($serialized);
  1079.     }
  1080.     /** @see \Serializable::unserialize() */
  1081.     public function __unserialize($serialized)
  1082.     {
  1083.          list (
  1084.              $this->id,
  1085.              $this->email,
  1086.              $this->password,
  1087.              // see section on salt below
  1088.              // $this->salt
  1089.          ) = unserialize(serialize($serialized));
  1090.     }
  1091.     public function getActivationCode(): ?string
  1092.     {
  1093.         return $this->activationCode;
  1094.     }
  1095.     public function setActivationCode(?string $activationCode): self
  1096.     {
  1097.         $this->activationCode $activationCode;
  1098.         return $this;
  1099.     }
  1100.     public function getActivationCodeExpiredAt(): ?\DateTimeInterface
  1101.     {
  1102.         return $this->activationCodeExpiredAt;
  1103.     }
  1104.     public function setActivationCodeExpiredAt(?\DateTimeInterface $activationCodeExpiredAt): self
  1105.     {
  1106.         $this->activationCodeExpiredAt $activationCodeExpiredAt;
  1107.         return $this;
  1108.     }
  1109.     public function getResetCode(): ?string
  1110.     {
  1111.         return $this->resetCode;
  1112.     }
  1113.     public function setResetCode(?string $resetCode): self
  1114.     {
  1115.         $this->resetCode $resetCode;
  1116.         return $this;
  1117.     }
  1118.     public function getResetCodeExpiredAt(): ?\DateTimeInterface
  1119.     {
  1120.         return $this->resetCodeExpiredAt;
  1121.     }
  1122.     public function setResetCodeExpiredAt(?\DateTimeInterface $resetCodeExpiredAt): self
  1123.     {
  1124.         $this->resetCodeExpiredAt $resetCodeExpiredAt;
  1125.         return $this;
  1126.     }
  1127.     public function getDeviceTokens(): ?array
  1128.     {
  1129.         return $this->deviceTokens;
  1130.     }
  1131.     public function setDeviceTokens(?array $deviceTokens): self
  1132.     {
  1133.         $this->deviceTokens $deviceTokens;
  1134.         return $this;
  1135.     }
  1136.     /**
  1137.      * @return Collection<int, Discussion>
  1138.      */
  1139.     public function getSenderDiscussions(): Collection
  1140.     {
  1141.         return $this->senderDiscussions;
  1142.     }
  1143.     public function addSenderDiscussion(Discussion $senderDiscussion): self
  1144.     {
  1145.         if (!$this->senderDiscussions->contains($senderDiscussion)) {
  1146.             $this->senderDiscussions[] = $senderDiscussion;
  1147.             $senderDiscussion->setCreatedBy($this);
  1148.         }
  1149.         return $this;
  1150.     }
  1151.     public function removeSenderDiscussion(Discussion $senderDiscussion): self
  1152.     {
  1153.         if ($this->senderDiscussions->removeElement($senderDiscussion)) {
  1154.             // set the owning side to null (unless already changed)
  1155.             if ($senderDiscussion->getCreatedBy() === $this) {
  1156.                 $senderDiscussion->setCreatedBy(null);
  1157.             }
  1158.         }
  1159.         return $this;
  1160.     }
  1161.     /**
  1162.      * @return Collection<int, Discussion>
  1163.      */
  1164.     public function getReceiverDiscussions(): Collection
  1165.     {
  1166.         return $this->receiverDiscussions;
  1167.     }
  1168.     public function addReceiverDiscussion(Discussion $receiverDiscussion): self
  1169.     {
  1170.         if (!$this->receiverDiscussions->contains($receiverDiscussion)) {
  1171.             $this->receiverDiscussions[] = $receiverDiscussion;
  1172.             $receiverDiscussion->setCreatedBy($this);
  1173.         }
  1174.         return $this;
  1175.     }
  1176.     public function removeReceiverDiscussion(Discussion $receiverDiscussion): self
  1177.     {
  1178.         if ($this->receiverDiscussions->removeElement($receiverDiscussion)) {
  1179.             // set the owning side to null (unless already changed)
  1180.             if ($receiverDiscussion->getCreatedBy() === $this) {
  1181.                 $receiverDiscussion->setCreatedBy(null);
  1182.             }
  1183.         }
  1184.         return $this;
  1185.     }
  1186.     /**
  1187.      * @return Collection<int, Message>
  1188.      */
  1189.     public function getMessages(): Collection
  1190.     {
  1191.         return $this->messages;
  1192.     }
  1193.     public function addMessage(Message $message): self
  1194.     {
  1195.         if (!$this->messages->contains($message)) {
  1196.             $this->messages[] = $message;
  1197.             $message->setReceiver($this);
  1198.         }
  1199.         return $this;
  1200.     }
  1201.     public function removeMessage(Message $message): self
  1202.     {
  1203.         if ($this->messages->removeElement($message)) {
  1204.             // set the owning side to null (unless already changed)
  1205.             if ($message->getReceiver() === $this) {
  1206.                 $message->setReceiver(null);
  1207.             }
  1208.         }
  1209.         return $this;
  1210.     }
  1211.     public function isVerified(): bool
  1212.     {
  1213.         return $this->isVerified;
  1214.     }
  1215.     public function setIsVerified(bool $isVerified): self
  1216.     {
  1217.         $this->isVerified $isVerified;
  1218.         return $this;
  1219.     }
  1220.     public function getProfileColor(): ?string
  1221.     {
  1222.         return $this->profileColor;
  1223.     }
  1224.     public function setProfileColor(?string $profileColor): self
  1225.     {
  1226.         $this->profileColor $profileColor;
  1227.         return $this;
  1228.     }
  1229.     /**
  1230.      * @return Collection<int, Program>
  1231.      */
  1232.     public function getPrograms(): Collection
  1233.     {
  1234.         return $this->programs;
  1235.     }
  1236.     public function addProgram(Program $program): self
  1237.     {
  1238.         if (!$this->programs->contains($program)) {
  1239.             $this->programs[] = $program;
  1240.             $program->addUser($this);
  1241.         }
  1242.         return $this;
  1243.     }
  1244.     public function removeProgram(Program $program): self
  1245.     {
  1246.         if ($this->programs->removeElement($program)) {
  1247.             $program->removeUser($this);
  1248.         }
  1249.         return $this;
  1250.     }
  1251.     /**
  1252.      * @return Collection<int, UserModuleParticipation>
  1253.      */
  1254.     public function getUserModuleParticipations(): Collection
  1255.     {
  1256.         return $this->userModuleParticipations;
  1257.     }
  1258.     public function addUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  1259.     {
  1260.         if (!$this->userModuleParticipations->contains($userModuleParticipation)) {
  1261.             $this->userModuleParticipations[] = $userModuleParticipation;
  1262.             $userModuleParticipation->setParticipant($this);
  1263.         }
  1264.         return $this;
  1265.     }
  1266.     public function removeUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  1267.     {
  1268.         if ($this->userModuleParticipations->removeElement($userModuleParticipation)) {
  1269.             // set the owning side to null (unless already changed)
  1270.             if ($userModuleParticipation->getParticipant() === $this) {
  1271.                 $userModuleParticipation->setParticipant(null);
  1272.             }
  1273.         }
  1274.         return $this;
  1275.     }
  1276.     public function isIsInternalAccount(): ?bool
  1277.     {
  1278.         return $this->isInternalAccount;
  1279.     }
  1280.     public function setIsInternalAccount(?bool $isInternalAccount): self
  1281.     {
  1282.         $this->isInternalAccount $isInternalAccount;
  1283.         return $this;
  1284.     }
  1285.     public function getElapsedTime(): ?int
  1286.     {
  1287.         return $this->elapsedTime;
  1288.     }
  1289.     public function setElapsedTime(?int $elapsedTime): self
  1290.     {
  1291.         $this->elapsedTime $elapsedTime;
  1292.         return $this;
  1293.     }
  1294.     /**
  1295.      * @return Collection<int, Notification>
  1296.      */
  1297.     public function getNotifications(): Collection
  1298.     {
  1299.         return $this->notifications;
  1300.     }
  1301.     public function addNotification(Notification $notification): self
  1302.     {
  1303.         if (!$this->notifications->contains($notification)) {
  1304.             $this->notifications[] = $notification;
  1305.             $notification->setReceiver($this);
  1306.         }
  1307.         return $this;
  1308.     }
  1309.     public function removeNotification(Notification $notification): self
  1310.     {
  1311.         if ($this->notifications->removeElement($notification)) {
  1312.             // set the owning side to null (unless already changed)
  1313.             if ($notification->getReceiver() === $this) {
  1314.                 $notification->setReceiver(null);
  1315.             }
  1316.         }
  1317.         return $this;
  1318.     }
  1319.     /**
  1320.      * @return Collection<int, NotificationReceiver>
  1321.      */
  1322.     public function getNotificationReceivers(): Collection
  1323.     {
  1324.         return $this->notificationReceivers;
  1325.     }
  1326.     public function addNotificationReceiver(NotificationReceiver $notificationReceiver): self
  1327.     {
  1328.         if (!$this->notificationReceivers->contains($notificationReceiver)) {
  1329.             $this->notificationReceivers[] = $notificationReceiver;
  1330.             $notificationReceiver->setReceiver($this);
  1331.         }
  1332.         return $this;
  1333.     }
  1334.     public function removeNotificationReceiver(NotificationReceiver $notificationReceiver): self
  1335.     {
  1336.         if ($this->notificationReceivers->removeElement($notificationReceiver)) {
  1337.             // set the owning side to null (unless already changed)
  1338.             if ($notificationReceiver->getReceiver() === $this) {
  1339.                 $notificationReceiver->setReceiver(null);
  1340.             }
  1341.         }
  1342.         return $this;
  1343.     }
  1344.     public function getLastLoginNotifiedAt(): ?\DateTimeInterface
  1345.     {
  1346.         return $this->lastLoginNotifiedAt;
  1347.     }
  1348.     public function setLastLoginNotifiedAt(?\DateTimeInterface $lastLoginNotifiedAt): self
  1349.     {
  1350.         $this->lastLoginNotifiedAt $lastLoginNotifiedAt;
  1351.         return $this;
  1352.     }
  1353.     /**
  1354.      * @return Collection<int, Message>
  1355.      */
  1356.     public function getReceiverMessages(): Collection
  1357.     {
  1358.         return $this->receiverMessages;
  1359.     }
  1360.     public function addReceiverMessage(Message $receiverMessage): self
  1361.     {
  1362.         if (!$this->receiverMessages->contains($receiverMessage)) {
  1363.             $this->receiverMessages[] = $receiverMessage;
  1364.             $receiverMessage->setReceiver($this);
  1365.         }
  1366.         return $this;
  1367.     }
  1368.     public function removeReceiverMessage(Message $receiverMessage): self
  1369.     {
  1370.         if ($this->receiverMessages->removeElement($receiverMessage)) {
  1371.             // set the owning side to null (unless already changed)
  1372.             if ($receiverMessage->getReceiver() === $this) {
  1373.                 $receiverMessage->setReceiver(null);
  1374.             }
  1375.         }
  1376.         return $this;
  1377.     }
  1378. }