src/Entity/User.php line 16

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\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  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. #[ORM\Entity(repositoryClassUserRepository::class)]
  12. #[UniqueEntity('phone'message'Le numéro de téléphone est déjà utilisé')]
  13. class User implements UserInterfacePasswordAuthenticatedUserInterface
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column(length180uniquetrue)]
  20.     private ?string $phone null;
  21.     #[ORM\Column]
  22.     private ?array $roles = [];
  23.     /**
  24.      * @var string|null The hashed password
  25.      */
  26.     #[ORM\Column(nullabletrue)]
  27.     private ?string $password null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $firstname null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $lastname null;
  32.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  33.     private ?\DateTimeInterface $birthday null;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $adress null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $adressBis null;
  38.     #[ORM\Column(nullabletrue)]
  39.     private ?int $zipcode null;
  40.     #[ORM\Column(length255nullabletrue)]
  41.     private ?string $city null;
  42.     #[ORM\Column(length255)]
  43.     private ?string $email null;
  44.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  45.     private ?\DateTimeInterface $created_at null;
  46.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  47.     private ?\DateTimeInterface $edited_at null;
  48.     #[ORM\Column(nullabletrue)]
  49.     private ?bool $handicapped false;
  50.     #[ORM\Column(length1024nullabletrue)]
  51.     private ?string $reset_token null;
  52.     #[ORM\Column]
  53.     private ?bool $enabled false;
  54.     #[ORM\Column(nullabletrue)]
  55.     private ?int $admission null;
  56.     #[ORM\Column(length1nullabletrue)]
  57.     private ?string $ranking null;
  58.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  59.     private ?string $situation null;
  60.     #[ORM\Column]
  61.     private ?bool $drivinglicence false;
  62.     #[ORM\Column(length255nullabletrue)]
  63.     private ?string $rgpd null;
  64.     #[ORM\Column]
  65.     private ?bool $hasCompany false;
  66.     #[ORM\Column(type:'string'length255nullabletrue)]
  67.     private ?string $countryCode null;
  68.     #[ORM\Column(length255nullabletrue)]
  69.     private ?string $verificationCode null;
  70.     #[ORM\Column]
  71.     private ?bool $verified false;
  72.     #[ORM\ManyToOne(inversedBy'User')]
  73.     private ?Progress $progress null;
  74.     #[ORM\OneToMany(mappedBy'User'targetEntityAttachments::class)]
  75.     private Collection $attachments;
  76.     #[ORM\OneToMany(mappedBy'user'targetEntityLogUser::class)]
  77.     private Collection $logUsers;
  78.     #[ORM\Column(nullabletrue)]
  79.     private ?bool $parcourssup false;
  80.     #[ORM\ManyToOne(inversedBy'users')]
  81.     private ?Training $training null;
  82.     #[ORM\OneToMany(mappedBy'user'targetEntityMCQResult::class)]
  83.     private Collection $mCQResults;
  84.     #[ORM\OneToMany(mappedBy'user'targetEntityScore::class)]
  85.     private Collection $scores;
  86.     #[ORM\OneToMany(mappedBy'user'targetEntityStudentResponse::class)]
  87.     private Collection $studentResponses;
  88.     #[ORM\OneToMany(mappedBy'user'targetEntityLogAttachments::class)]
  89.     private Collection $logAttachments;
  90.     #[ORM\Column(nullabletrue)]
  91.     private ?bool $validatedPj false;
  92.     #[ORM\Column(nullabletrue)]
  93.     private ?bool $mCQValid false;
  94.     #[ORM\ManyToOne(inversedBy'users')]
  95.     private ?AdmissionCategory $admissionCategory null;
  96.     #[ORM\OneToMany(mappedBy'user'targetEntityCommitment::class)]
  97.     private Collection $commitments;
  98.     #[ORM\OneToMany(mappedBy'user'targetEntityApplication::class)]
  99.     private Collection $applications;
  100.     #[ORM\OneToMany(mappedBy'user'targetEntityMCQQuestionsStorage::class)]
  101.     private Collection $mcqQuestionsStorages;
  102.     #[ORM\ManyToMany(targetEntityAppointment::class, mappedBy'user')]
  103.     private Collection $appointments;
  104.     #[ORM\OneToMany(mappedBy'user'targetEntityAppointmentsCheck::class)]
  105.     private Collection $appointmentsChecks;
  106.     #[ORM\OneToMany(mappedBy'user'targetEntityBookCv::class)]
  107.     private Collection $bookCvs;
  108.     #[ORM\Column(nullabletrue)]
  109.     private ?bool $waitCommitment false;
  110.     #[ORM\OneToMany(mappedBy'user'targetEntityHistoryUser::class)]
  111.     private Collection $historyUsers;
  112.     #[ORM\OneToMany(mappedBy'user'targetEntityAcapellaDemand::class)]
  113.     private Collection $acapellaDemands;
  114.     #[ORM\Column(nullabletrue)]
  115.     private ?bool $commimtmentInfo false;
  116.     #[ORM\OrderBy(['createdAt' => 'DESC'])]
  117.     #[ORM\OneToMany(mappedBy'user'targetEntityUserComment::class)]
  118.     private Collection $userComments;
  119.     #[ORM\Column(nullabletrue)]
  120.     private ?string $id_ypareo null;
  121.     #[ORM\Column]
  122.     private ?bool $poursuite false;
  123.     #[ORM\OneToMany(mappedBy'User'targetEntityComplementaryPj::class)]
  124.     private Collection $complementaryPjs;
  125.     #[ORM\OneToMany(mappedBy'user'targetEntityAttachmentsAf::class)]
  126.     private Collection $attachmentsAfs;
  127.     #[ORM\OneToMany(mappedBy'users'targetEntityLegalRepresentative::class)]
  128.     private Collection $legalRepresentatives;
  129.     #[ORM\Column(length255nullabletrue)]
  130.     private ?string $lastSchoolName null;
  131.     #[ORM\Column(length255nullabletrue)]
  132.     private ?string $brevoId null;
  133.     #[ORM\OneToMany(mappedBy'user'targetEntityLogSms::class)]
  134.     private Collection $sms;
  135.     public function __construct()
  136.     {
  137.         $this->attachments = new ArrayCollection();
  138.         $this->logUsers = new ArrayCollection();
  139.         $this->mCQResults = new ArrayCollection();
  140.         $this->scores = new ArrayCollection();
  141.         $this->studentResponses = new ArrayCollection();
  142.         $this->logAttachments = new ArrayCollection();
  143.         $this->commitments = new ArrayCollection();
  144.         $this->applications = new ArrayCollection();
  145.         $this->mcqQuestionsStorages = new ArrayCollection();
  146.         $this->appointments = new ArrayCollection();
  147.         $this->appointmentsChecks = new ArrayCollection();
  148.         $this->bookCvs = new ArrayCollection();
  149.         $this->historyUsers = new ArrayCollection();
  150.         $this->acapellaDemands = new ArrayCollection();
  151.         $this->userComments = new ArrayCollection();
  152.         $this->complementaryPjs = new ArrayCollection();
  153.         $this->attachmentsAfs = new ArrayCollection();
  154.         $this->legalRepresentatives = new ArrayCollection();
  155.         $this->sms = new ArrayCollection();
  156.     }
  157.     public function getId(): ?int
  158.     {
  159.         return $this->id;
  160.     }
  161.     public function getPhone(): ?string
  162.     {
  163.         return $this->phone;
  164.     }
  165.     public function setPhone(string $phone): self
  166.     {
  167.         $this->phone $phone;
  168.         return $this;
  169.     }
  170.     /**
  171.      * A visual identifier that represents this user.
  172.      *
  173.      * @see UserInterface
  174.      */
  175.     public function getUserIdentifier(): string
  176.     {
  177.         return (string) $this->phone;
  178.     }
  179.     /**
  180.      * @see UserInterface
  181.      */
  182.     public function getRoles(): array
  183.     {
  184.         $roles $this->roles;
  185.         // guarantee every user at least has ROLE_USER
  186.         $roles[] = 'ROLE_USER';
  187.         return array_unique($roles);
  188.     }
  189.     public function setRoles(array $roles): self
  190.     {
  191.         $this->roles $roles;
  192.         return $this;
  193.     }
  194.     /**
  195.      * @see PasswordAuthenticatedUserInterface
  196.      */
  197.     public function getPassword(): string
  198.     {
  199.         return $this->password;
  200.     }
  201.     public function setPassword(string $password): self
  202.     {
  203.         $this->password $password;
  204.         return $this;
  205.     }
  206.     /**
  207.      * @see UserInterface
  208.      */
  209.     public function eraseCredentials()
  210.     {
  211.         // If you store any temporary, sensitive data on the user, clear it here
  212.         // $this->plainPassword = null;
  213.     }
  214.     public function getFirstname(): ?string
  215.     {
  216.         return $this->firstname;
  217.     }
  218.     public function setFirstname(string $firstname): self
  219.     {
  220.         $this->firstname $firstname;
  221.         return $this;
  222.     }
  223.     public function getLastname(): ?string
  224.     {
  225.         return $this->lastname;
  226.     }
  227.     public function setLastname(string $lastname): self
  228.     {
  229.         $this->lastname $lastname;
  230.         return $this;
  231.     }
  232.     public function getBirthday(): ?\DateTimeInterface
  233.     {
  234.         return $this->birthday;
  235.     }
  236.     public function setBirthday(?\DateTimeInterface $birthday): self
  237.     {
  238.         $this->birthday $birthday;
  239.         return $this;
  240.     }
  241.     public function getAdress(): ?string
  242.     {
  243.         return $this->adress;
  244.     }
  245.     public function setAdress(string $adress): self
  246.     {
  247.         $this->adress $adress;
  248.         return $this;
  249.     }
  250.     public function getAdressBis(): ?string
  251.     {
  252.         return $this->adressBis;
  253.     }
  254.     public function setAdressBis(string $adressBis): self
  255.     {
  256.         $this->adressBis $adressBis;
  257.         return $this;
  258.     }
  259.     public function getZipcode(): ?int
  260.     {
  261.         return $this->zipcode;
  262.     }
  263.     public function setZipcode(int $zipcode): self
  264.     {
  265.         $this->zipcode $zipcode;
  266.         return $this;
  267.     }
  268.     public function getCity(): ?string
  269.     {
  270.         return $this->city;
  271.     }
  272.     public function setCity(string $city): self
  273.     {
  274.         $this->city $city;
  275.         return $this;
  276.     }
  277.     public function getEmail(): ?string
  278.     {
  279.         return $this->email;
  280.     }
  281.     public function setEmail(string $email): self
  282.     {
  283.         $this->email $email;
  284.         return $this;
  285.     }
  286.     public function getCreatedAt(): ?\DateTimeInterface
  287.     {
  288.         return $this->created_at;
  289.     }
  290.     public function setCreatedAt(\DateTimeInterface $created_at): self
  291.     {
  292.         $this->created_at $created_at;
  293.         return $this;
  294.     }
  295.     public function getEditedAt(): ?\DateTimeInterface
  296.     {
  297.         return $this->edited_at;
  298.     }
  299.     public function setEditedAt(\DateTimeInterface $edited_at): self
  300.     {
  301.         $this->edited_at $edited_at;
  302.         return $this;
  303.     }
  304.     public function isHandicapped(): ?bool
  305.     {
  306.         return $this->handicapped;
  307.     }
  308.     public function setHandicapped(bool $handicapped): self
  309.     {
  310.         $this->handicapped $handicapped;
  311.         return $this;
  312.     }
  313.     public function getResetToken(): ?string
  314.     {
  315.         return $this->reset_token;
  316.     }
  317.     public function setResetToken(string $reset_token): self
  318.     {
  319.         $this->reset_token $reset_token;
  320.         return $this;
  321.     }
  322.     public function isEnabled(): ?bool
  323.     {
  324.         return $this->enabled;
  325.     }
  326.     public function setEnabled(bool $enabled): self
  327.     {
  328.         $this->enabled $enabled;
  329.         return $this;
  330.     }
  331.     public function getAdmission(): ?int
  332.     {
  333.         return $this->admission;
  334.     }
  335.     public function setAdmission(int $admission): self
  336.     {
  337.         $this->admission $admission;
  338.         return $this;
  339.     }
  340.     public function getRanking(): ?string
  341.     {
  342.         return $this->ranking;
  343.     }
  344.     public function setRanking(string $ranking): self
  345.     {
  346.         $this->ranking $ranking;
  347.         return $this;
  348.     }
  349.     public function getSituation(): ?string
  350.     {
  351.         return $this->situation;
  352.     }
  353.     public function setSituation(string $situation): self
  354.     {
  355.         $this->situation $situation;
  356.         return $this;
  357.     }
  358.     public function isDrivinglicence(): ?bool
  359.     {
  360.         return $this->drivinglicence;
  361.     }
  362.     public function setDrivinglicence(bool $drivinglicence): self
  363.     {
  364.         $this->drivinglicence $drivinglicence;
  365.         return $this;
  366.     }
  367.     public function getRgpd(): ?string
  368.     {
  369.         return $this->rgpd;
  370.     }
  371.     public function setRgpd(?string $rgpd): self
  372.     {
  373.         $this->rgpd $rgpd;
  374.         return $this;
  375.     }
  376.     public function isHasCompany(): ?bool
  377.     {
  378.         return $this->hasCompany;
  379.     }
  380.     public function setHasCompany(bool $hasCompany): self
  381.     {
  382.         $this->hasCompany $hasCompany;
  383.         return $this;
  384.     }
  385.     public function getCountryCode(): ?string
  386.     {
  387.         return $this->countryCode;
  388.     }
  389.     public function setCountryCode(string $countryCode): self
  390.     {
  391.         $this->countryCode $countryCode;
  392.         return $this;
  393.     }
  394.     public function getVerificationCode(): ?string
  395.     {
  396.         return $this->verificationCode;
  397.     }
  398.     public function setVerificationCode(?string $verificationCode): self
  399.     {
  400.         $this->verificationCode $verificationCode;
  401.         return $this;
  402.     }
  403.     public function getVerified(): ?bool
  404.     {
  405.         return $this->verified;
  406.     }
  407.     public function setVerified(bool $verified): self
  408.     {
  409.         $this->verified $verified;
  410.         return $this;
  411.     }
  412.     public function getProgress(): ?Progress
  413.     {
  414.         return $this->progress;
  415.     }
  416.     public function setProgress(?Progress $progress): self
  417.     {
  418.         $this->progress $progress;
  419.         return $this;
  420.     }
  421.     /**
  422.      * @return Collection<int, Attachments>
  423.      */
  424.     public function getAttachments(): Collection
  425.     {
  426.         return $this->attachments;
  427.     }
  428.     public function addAttachment(Attachments $attachment): self
  429.     {
  430.         if (!$this->attachments->contains($attachment)) {
  431.             $this->attachments->add($attachment);
  432.             $attachment->setUser($this);
  433.         }
  434.         return $this;
  435.     }
  436.     public function removeAttachment(Attachments $attachment): self
  437.     {
  438.         if ($this->attachments->removeElement($attachment)) {
  439.             // set the owning side to null (unless already changed)
  440.             if ($attachment->getUser() === $this) {
  441.                 $attachment->setUser(null);
  442.             }
  443.         }
  444.         return $this;
  445.     }
  446.     /**
  447.      * @return Collection<int, LogUser>
  448.      */
  449.     public function getLogUsers(): Collection
  450.     {
  451.         return $this->logUsers;
  452.     }
  453.     public function addLogUser(LogUser $logUser): self
  454.     {
  455.         if (!$this->logUsers->contains($logUser)) {
  456.             $this->logUsers->add($logUser);
  457.             $logUser->setUser($this);
  458.         }
  459.         return $this;
  460.     }
  461.     public function removeLogUser(LogUser $logUser): self
  462.     {
  463.         if ($this->logUsers->removeElement($logUser)) {
  464.             // set the owning side to null (unless already changed)
  465.             if ($logUser->getUser() === $this) {
  466.                 $logUser->setUser(null);
  467.             }
  468.         }
  469.         return $this;
  470.     }
  471.     public function isParcourssup(): ?bool
  472.     {
  473.         return $this->parcourssup;
  474.     }
  475.     public function setParcourssup(bool $parcourssup): self
  476.     {
  477.         $this->parcourssup $parcourssup;
  478.         return $this;
  479.     }
  480.     public function getTraining(): ?Training
  481.     {
  482.         return $this->training;
  483.     }
  484.     public function setTraining(?Training $training): self
  485.     {
  486.         $this->training $training;
  487.         return $this;
  488.     }
  489.     /**
  490.      * @return Collection<int, MCQResult>
  491.      */
  492.     public function getMCQResults(): Collection
  493.     {
  494.         return $this->mCQResults;
  495.     }
  496.     public function addMCQResult(MCQResult $mCQResult): self
  497.     {
  498.         if (!$this->mCQResults->contains($mCQResult)) {
  499.             $this->mCQResults->add($mCQResult);
  500.             $mCQResult->setUser($this);
  501.         }
  502.         return $this;
  503.     }
  504.     /**
  505.      * @return Collection<int, MCQQuestionsStorage>
  506.      */
  507.     public function getMcqQuestionsStorages(): Collection
  508.     {
  509.         return $this->mcqQuestionsStorages;
  510.     }
  511.     public function addMcqQuestionsStorages(MCQQuestionsStorage $mcqQuestionsStorages): self
  512.     {
  513.         if (!$this->mcqQuestionsStorages->contains($mcqQuestionsStorages)) {
  514.             $this->mcqQuestionsStorages->add($mcqQuestionsStorages);
  515.             $mcqQuestionsStorages->setUser($this);
  516.         }
  517.         return $this;
  518.     }
  519.     public function removeMCQResult(MCQResult $mCQResult): self
  520.     {
  521.         if ($this->mCQResults->removeElement($mCQResult)) {
  522.             // set the owning side to null (unless already changed)
  523.             if ($mCQResult->getUser() === $this) {
  524.                 $mCQResult->setUser(null);
  525.             }
  526.         }
  527.             return $this;
  528.     }
  529.     public function removeMcqQuestionsStorages(MCQQuestionsStorage $mcqQuestionsStorages): self
  530.     {
  531.         if ($this->mcqQuestionsStorages->removeElement($mcqQuestionsStorages)) {
  532.             // set the owning side to null (unless already changed)
  533.             if ($mcqQuestionsStorages->getUser() === $this) {
  534.                 $mcqQuestionsStorages->setUser(null);
  535.             }
  536.         }
  537.         return $this;
  538.     }
  539.     /**
  540.      * @return Collection<int, Score>
  541.      */
  542.     public function getScores(): Collection
  543.     {
  544.         return $this->scores;
  545.     }
  546.     public function addScore(Score $score): self
  547.     {
  548.         if (!$this->scores->contains($score)) {
  549.             $this->scores->add($score);
  550.             $score->setUser($this);
  551.         }
  552.         return $this;
  553.     }
  554.     public function removeScore(Score $score): self
  555.     {
  556.         if ($this->scores->removeElement($score)) {
  557.             // set the owning side to null (unless already changed)
  558.             if ($score->getUser() === $this) {
  559.                 $score->setUser(null);
  560.             }
  561.         }
  562.         return $this;
  563.     }
  564.     /**
  565.      * @return Collection<int, StudentResponse>
  566.      */
  567.     public function getStudentResponses(): Collection
  568.     {
  569.         return $this->studentResponses;
  570.     }
  571.     public function addStudentResponse(StudentResponse $studentResponse): self
  572.     {
  573.         if (!$this->studentResponses->contains($studentResponse)) {
  574.             $this->studentResponses->add($studentResponse);
  575.             $studentResponse->setUser($this);
  576.         }
  577.         return $this;
  578.     }
  579.     public function removeStudentResponse(StudentResponse $studentResponse): self
  580.     {
  581.         if ($this->studentResponses->removeElement($studentResponse)) {
  582.             // set the owning side to null (unless already changed)
  583.             if ($studentResponse->getUser() === $this) {
  584.                 $studentResponse->setUser(null);
  585.             }
  586.         }
  587.         return $this;
  588.     }
  589.     /**
  590.      * @return Collection<int, LogAttachments>
  591.      */
  592.     public function getLogAttachments(): Collection
  593.     {
  594.         return $this->logAttachments;
  595.     }
  596.     public function addLogAttachment(LogAttachments $logAttachment): self
  597.     {
  598.         if (!$this->logAttachments->contains($logAttachment)) {
  599.             $this->logAttachments->add($logAttachment);
  600.             $logAttachment->setUser($this);
  601.         }
  602.         return $this;
  603.     }
  604.     public function removeLogAttachment(LogAttachments $logAttachment): self
  605.     {
  606.         if ($this->logAttachments->removeElement($logAttachment)) {
  607.             // set the owning side to null (unless already changed)
  608.             if ($logAttachment->getUser() === $this) {
  609.                 $logAttachment->setUser(null);
  610.             }
  611.         }
  612.         return $this;
  613.     }
  614.     public function isValidatedPj(): ?bool
  615.     {
  616.         return $this->validatedPj;
  617.     }
  618.     public function setValidatedPj(bool $validatedPj): self
  619.     {
  620.         $this->validatedPj $validatedPj;
  621.         return $this;
  622.     }
  623.     public function isMCQValid(): ?bool
  624.     {
  625.         return $this->mCQValid;
  626.     }
  627.     public function setMCQValid(?bool $mCQValid): self
  628.     {
  629.         $this->mCQValid $mCQValid;
  630.         return $this;
  631.     }
  632.     public function getAdmissionCategory(): ?AdmissionCategory
  633.     {
  634.         return $this->admissionCategory;
  635.     }
  636.     public function setAdmissionCategory(?AdmissionCategory $admissionCategory): self
  637.     {
  638.         $this->admissionCategory $admissionCategory;
  639.         return $this;
  640.     }
  641.     /**
  642.      * @return Collection<int, Commitment>
  643.      */
  644.     public function getCommitments(): Collection
  645.     {
  646.         return $this->commitments;
  647.     }
  648.     public function addCommitment(Commitment $commitment): self
  649.     {
  650.         if (!$this->commitments->contains($commitment)) {
  651.             $this->commitments->add($commitment);
  652.             $commitment->setUser($this);
  653.         }
  654.         return $this;
  655.     }
  656.     public function removeCommitment(Commitment $commitment): self
  657.     {
  658.         if ($this->commitments->removeElement($commitment)) {
  659.             // set the owning side to null (unless already changed)
  660.             if ($commitment->getUser() === $this) {
  661.                 $commitment->setUser(null);
  662.             }
  663.         }
  664.         return $this;
  665.     }
  666.     /**
  667.      * @return Collection<int, Application>
  668.      */
  669.     public function getApplications(): Collection
  670.     {
  671.         return $this->applications;
  672.     }
  673.     public function addApplication(Application $application): self
  674.     {
  675.         if (!$this->applications->contains($application)) {
  676.             $this->applications->add($application);
  677.             $application->setUser($this);
  678.         }
  679.         return $this;
  680.     }
  681.     public function removeApplication(Application $application): self
  682.     {
  683.         if ($this->applications->removeElement($application)) {
  684.             // set the owning side to null (unless already changed)
  685.             if ($application->getUser() === $this) {
  686.                 $application->setUser(null);
  687.             }
  688.         }
  689.         return $this;
  690.     }
  691.     /**
  692.      * @return Collection<int, Appointment>
  693.      */
  694.     public function getAppointments(): Collection
  695.     {
  696.         return $this->appointments;
  697.     }
  698.     public function addAppointment(Appointment $appointment): self
  699.     {
  700.         if (!$this->appointments->contains($appointment)) {
  701.             $this->appointments->add($appointment);
  702.             $appointment->addUser($this);
  703.         }
  704.         return $this;
  705.     }
  706.     public function removeAppointment(Appointment $appointment): self
  707.     {
  708.         if ($this->appointments->removeElement($appointment)) {
  709.             $appointment->removeUser($this);
  710.         }
  711.         return $this;
  712.     }
  713.     /**
  714.      * @return Collection<int, AppointmentsCheck>
  715.      */
  716.     public function getAppointmentsChecks(): Collection
  717.     {
  718.         return $this->appointmentsChecks;
  719.     }
  720.     public function addAppointmentsChecks(AppointmentsCheck $appointmentsCheck): self
  721.     {
  722.         if (!$this->appointmentsChecks->contains($appointmentsCheck)) {
  723.             $this->appointmentsChecks->add($appointmentsCheck);
  724.             $appointmentsCheck->setUser($this);
  725.         }
  726.         return $this;
  727.     }
  728.     public function removeAppointmentsChecks(AppointmentsCheck $appointmentsCheck): self
  729.     {
  730.         if ($this->appointmentsChecks->removeElement($appointmentsCheck)) {
  731.             // set the owning side to null (unless already changed)
  732.             if ($appointmentsCheck->getUser() === $this) {
  733.                 $appointmentsCheck->setUser(null);
  734.             }
  735.         }
  736.         return $this;
  737.     }
  738.     /**
  739.      * @return Collection<int, BookCv>
  740.      */
  741.     public function getBookCvs(): Collection
  742.     {
  743.         return $this->bookCvs;
  744.     }
  745.     public function addBookCv(BookCv $bookCv): self
  746.     {
  747.         if (!$this->bookCvs->contains($bookCv)) {
  748.             $this->bookCvs->add($bookCv);
  749.             $bookCv->setUser($this);
  750.         }
  751.         return $this;
  752.     }
  753.     public function removeBookCv(BookCv $bookCv): self
  754.     {
  755.         if ($this->bookCvs->removeElement($bookCv)) {
  756.             // set the owning side to null (unless already changed)
  757.             if ($bookCv->getUser() === $this) {
  758.                 $bookCv->setUser(null);
  759.             }
  760.         }
  761.         return $this;
  762.     }
  763.     public function isWaitCommitment(): ?bool
  764.     {
  765.         return $this->waitCommitment;
  766.     }
  767.     public function setWaitCommitment(?bool $waitCommitment): self
  768.     {
  769.         $this->waitCommitment $waitCommitment;
  770.         return $this;
  771.     }
  772.     /**
  773.      * @return Collection<int, HistoryUser>
  774.      */
  775.     public function getHistoryUsers(): Collection
  776.     {
  777.         return $this->historyUsers;
  778.     }
  779.     public function addHistoryUser(HistoryUser $historyUser): self
  780.     {
  781.         if (!$this->historyUsers->contains($historyUser)) {
  782.             $this->historyUsers->add($historyUser);
  783.             $historyUser->setUser($this);
  784.         }
  785.         return $this;
  786.     }
  787.     public function removeHistoryUser(HistoryUser $historyUser): self
  788.     {
  789.         if ($this->historyUsers->removeElement($historyUser)) {
  790.             // set the owning side to null (unless already changed)
  791.             if ($historyUser->getUser() === $this) {
  792.                 $historyUser->setUser(null);
  793.             }
  794.         }
  795.         return $this;
  796.     }
  797.     /**
  798.      * @return Collection<int, AcapellaDemand>
  799.      */
  800.     public function getAcapellaDemands(): Collection
  801.     {
  802.         return $this->acapellaDemands;
  803.     }
  804.     public function addAcapellaDemand(AcapellaDemand $acapellaDemand): self
  805.     {
  806.         if (!$this->acapellaDemands->contains($acapellaDemand)) {
  807.             $this->acapellaDemands->add($acapellaDemand);
  808.             $acapellaDemand->setUser($this);
  809.         }
  810.         return $this;
  811.     }
  812.     public function removeAcapellaDemand(AcapellaDemand $acapellaDemand): self
  813.     {
  814.         if ($this->acapellaDemands->removeElement($acapellaDemand)) {
  815.             // set the owning side to null (unless already changed)
  816.             if ($acapellaDemand->getUser() === $this) {
  817.                 $acapellaDemand->setUser(null);
  818.             }
  819.         }
  820.         return $this;
  821.     }
  822.     public function isCommimtmentInfo(): ?bool
  823.     {
  824.         return $this->commimtmentInfo;
  825.     }
  826.     public function setCommimtmentInfo(?bool $commimtmentInfo): self
  827.     {
  828.         $this->commimtmentInfo $commimtmentInfo;
  829.         return $this;
  830.     }
  831.     /**
  832.      * @return Collection<int, UserComment>
  833.      */
  834.     public function getUserComments(): Collection
  835.     {
  836.         return $this->userComments;
  837.     }
  838.     public function addUserComment(UserComment $userComment): self
  839.     {
  840.         if (!$this->userComments->contains($userComment)) {
  841.             $this->userComments->add($userComment);
  842.             $userComment->setUser($this);
  843.         }
  844.         return $this;
  845.     }
  846.     public function removeUserComment(UserComment $userComment): self
  847.     {
  848.         if ($this->userComments->removeElement($userComment)) {
  849.             // set the owning side to null (unless already changed)
  850.             if ($userComment->getUser() === $this) {
  851.                 $userComment->setUser(null);
  852.             }
  853.         }
  854.         return $this;
  855.     }
  856.     public function getIdYpareo(): ?string
  857.     {
  858.         return $this->id_ypareo;
  859.     }
  860.     public function setIdYpareo(?string $id_ypareo): self
  861.     {
  862.         $this->id_ypareo $id_ypareo;
  863.         return $this;
  864.     }
  865.     public function toYpareo(?array $u_ypareo): self
  866.     {
  867.         if ($u_ypareo['adresse']['tel2'] != null) {
  868.             $this->setPhone($u_ypareo['adresse']['tel2']);
  869.         } else {
  870.             $this->setPhone($u_ypareo['adresse']['tel1']);
  871.         }
  872.         $mystringBirthday str_replace("/""-"$u_ypareo['dateNaissanceApprenant']);
  873.         $newDateString = new \DateTimeImmutable($mystringBirthday);
  874.         $this->setFirstname($u_ypareo['prenomApprenant']);
  875.         $this->setLastname($u_ypareo['nomApprenant']);
  876.         $this->setBirthday($newDateString);
  877.         $this->setAdress($u_ypareo['adresse']['adr1']);
  878.         $this->setCity($u_ypareo['adresse']['ville']);
  879.         $this->setZipcode($u_ypareo['adresse']['cp']);
  880.         $this->setEmail($u_ypareo['adresse']['email']);
  881.         $this->setHasCompany(false);
  882. //        $this->setStep(1);
  883.         $this->setHandicapped(false);
  884.         $this->setIdYpareo($u_ypareo['codeApprenant']);
  885.         return $this;
  886.     }
  887.     public function isPoursuite(): ?bool
  888.     {
  889.         return $this->poursuite;
  890.     }
  891.     public function setPoursuite(bool $poursuite): self
  892.     {
  893.         $this->poursuite $poursuite;
  894.         return $this;
  895.     }
  896.     /**
  897.      * @return Collection<int, ComplementaryPj>
  898.      */
  899.     public function getComplementaryPjs(): Collection
  900.     {
  901.         return $this->complementaryPjs;
  902.     }
  903.     public function addComplementaryPj(ComplementaryPj $complementaryPj): self
  904.     {
  905.         if (!$this->complementaryPjs->contains($complementaryPj)) {
  906.             $this->complementaryPjs->add($complementaryPj);
  907.             $complementaryPj->setUser($this);
  908.         }
  909.         return $this;
  910.     }
  911.     public function removeComplementaryPj(ComplementaryPj $complementaryPj): self
  912.     {
  913.         if ($this->complementaryPjs->removeElement($complementaryPj)) {
  914.             // set the owning side to null (unless already changed)
  915.             if ($complementaryPj->getUser() === $this) {
  916.                 $complementaryPj->setUser(null);
  917.             }
  918.         }
  919.         return $this;
  920.     }
  921.     /**
  922.      * @return Collection<int, AttachmentsAf>
  923.      */
  924.     public function getAttachmentsAfs(): Collection
  925.     {
  926.         return $this->attachmentsAfs;
  927.     }
  928.     public function addAttachmentsAf(AttachmentsAf $attachmentsAf): self
  929.     {
  930.         if (!$this->attachmentsAfs->contains($attachmentsAf)) {
  931.             $this->attachmentsAfs->add($attachmentsAf);
  932.             $attachmentsAf->setUser($this);
  933.         }
  934.         return $this;
  935.     }
  936.     public function removeAttachmentsAf(AttachmentsAf $attachmentsAf): self
  937.     {
  938.         if ($this->attachmentsAfs->removeElement($attachmentsAf)) {
  939.             // set the owning side to null (unless already changed)
  940.             if ($attachmentsAf->getUser() === $this) {
  941.                 $attachmentsAf->setUser(null);
  942.             }
  943.         }
  944.         return $this;
  945.     }
  946.     /**
  947.      * @return Collection<int, LegalRepresentative>
  948.      */
  949.     public function getLegalRepresentatives(): Collection
  950.     {
  951.         return $this->legalRepresentatives;
  952.     }
  953.     public function addLegalRepresentative(LegalRepresentative $legalRepresentative): self
  954.     {
  955.         if (!$this->legalRepresentatives->contains($legalRepresentative)) {
  956.             $this->legalRepresentatives->add($legalRepresentative);
  957.             $legalRepresentative->setUsers($this);
  958.         }
  959.         return $this;
  960.     }
  961.     public function removeLegalRepresentative(LegalRepresentative $legalRepresentative): self
  962.     {
  963.         if ($this->legalRepresentatives->removeElement($legalRepresentative)) {
  964.             // set the owning side to null (unless already changed)
  965.             if ($legalRepresentative->getUsers() === $this) {
  966.                 $legalRepresentative->setUsers(null);
  967.             }
  968.         }
  969.         return $this;
  970.     }
  971.     public function getLastSchoolName(): ?string
  972.     {
  973.         return $this->lastSchoolName;
  974.     }
  975.     public function setLastSchoolName(?string $lastSchoolName): self
  976.     {
  977.         $this->lastSchoolName $lastSchoolName;
  978.         return $this;
  979.     }
  980.     public function getBrevoId(): ?string
  981.     {
  982.         return $this->brevoId;
  983.     }
  984.     public function setBrevoId(?string $brevoId): self
  985.     {
  986.         $this->brevoId $brevoId;
  987.         return $this;
  988.     }
  989.     /**
  990.      * @return Collection<int, LogSms>
  991.      */
  992.     public function getSms(): Collection
  993.     {
  994.         return $this->sms;
  995.     }
  996.     public function addSms(LogSms $sms): static
  997.     {
  998.         if (!$this->sms->contains($sms)) {
  999.             $this->sms->add($sms);
  1000.             $sms->setUser($this);
  1001.         }
  1002.         return $this;
  1003.     }
  1004.     public function removeSms(LogSms $sms): static
  1005.     {
  1006.         if ($this->sms->removeElement($sms)) {
  1007.             // set the owning side to null (unless already changed)
  1008.             if ($sms->getUser() === $this) {
  1009.                 $sms->setUser(null);
  1010.             }
  1011.         }
  1012.         return $this;
  1013.     }
  1014. }