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