src/Entity/Profile.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProfileRepository;
  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. #[ORM\Entity(repositoryClass: ProfileRepository::class)]
  9. #[ORM\HasLifecycleCallbacks]
  10. class Profile
  11. {
  12.     const PERCENT_STEP_1 = 25;
  13.     const PERCENT_STEP_2 = 50;
  14.     const FORMATION_TYPE_INITIAL = 1;
  15.     const FORMATION_TYPE_ALTERNANCE = 2;
  16.     const QCM_LOCAL = 1;
  17.     const QCM_ONLINE = 2;
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column(type: 'integer')]
  21.     private $id;
  22.     #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'profiles', cascade: ['persist'])]
  23.     private ?\App\Entity\User $user = null;
  24.     #[ORM\ManyToMany(targetEntity: Program::class, inversedBy: 'profiles')]
  25.     private Collection $programs;
  26.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  27.     private ?string $schoolName = null;
  28.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  29.     private ?string $diplomaName = null;
  30.     #[ORM\ManyToOne(targetEntity: StudyLevel::class, inversedBy: 'profiles')]
  31.     private ?\App\Entity\StudyLevel $studyLevel = null;
  32.     #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'profiles')]
  33.     private ?\App\Entity\User $commercial = null;
  34.     #[ORM\ManyToOne(targetEntity: EnglishLevel::class, inversedBy: 'profiles')]
  35.     private ?\App\Entity\EnglishLevel $englishLevel = null;
  36.     #[ORM\OneToMany(targetEntity: ProfileFile::class, mappedBy: 'profile', orphanRemoval: true, cascade: ['persist', 'remove'])]
  37.     private Collection $profileFiles;
  38.     #[ORM\ManyToOne(targetEntity: Jury::class, inversedBy: 'profiles')]
  39.     private ?\App\Entity\Jury $jury = null;
  40.     #[ORM\ManyToOne(targetEntity: Oraux::class, inversedBy: 'profiles')]
  41.     private ?\App\Entity\Oraux $oraux = null;
  42.     #[ORM\ManyToOne(targetEntity: Status::class, inversedBy: 'profiles')]
  43.     private ?\App\Entity\Status $status = null;
  44.     #[ORM\ManyToOne(targetEntity: Campaign::class, inversedBy: 'profiles')]
  45.     private ?\App\Entity\Campaign $campaign = null;
  46.     #[ORM\OneToMany(targetEntity: AppointmentPerson::class, mappedBy: 'profile', orphanRemoval: true)]
  47.     private Collection $appointmentPerson;
  48.     #[ORM\ManyToOne(targetEntity: Program::class, inversedBy: 'selectedProfiles')]
  49.     private ?\App\Entity\Program $selectedProgram = null;
  50.     #[ORM\Column(type: 'json', nullable: true)]
  51.     private ?array $juryResult = [];
  52.     #[ORM\Column(type: 'date', nullable: true)]
  53.     private ?\DateTimeInterface $juryDate = null;
  54.     #[ORM\Column(type: 'json', nullable: true)]
  55.     private ?array $orauxResult = [];
  56.     #[ORM\Column(type: 'date', nullable: true)]
  57.     private ?\DateTimeInterface $orauxDate = null;
  58.     #[ORM\OneToMany(targetEntity: ProfileNote::class, mappedBy: 'profile', orphanRemoval: true, cascade: ['persist', 'remove'])]
  59.     private Collection $profileNotes;
  60.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  61.     private ?string $year = null;
  62.     #[ORM\Column(type: 'integer', nullable: true)]
  63.     private ?int $percent = null;
  64.     #[ORM\Column(type: 'json', nullable: true)]
  65.     private ?array $information = [];
  66.     #[ORM\Column(type: 'json', nullable: true)]
  67.     private ?array $marketing = [];
  68.     #[ORM\ManyToOne(targetEntity: MediaChannel::class, inversedBy: 'profiles')]
  69.     private ?\App\Entity\MediaChannel $mediaChannel = null;
  70.     #[ORM\ManyToOne(targetEntity: Landingpage::class, inversedBy: 'profiles')]
  71.     private ?\App\Entity\Landingpage $landingpage = null;
  72.     #[ORM\OneToMany(targetEntity: ProfileQcm::class, mappedBy: 'profile', orphanRemoval: true)]
  73.     private Collection $profileQcms;
  74.     #[ORM\Column(type: 'smallint', nullable: true)]
  75.     private ?int $typeFormation = null;
  76.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  77.     private ?string $hostCompany = null;
  78.     #[ORM\OneToMany(targetEntity: OpenDayPerson::class, mappedBy: 'profile', orphanRemoval: true)]
  79.     private Collection $openDayPeople;
  80.     #[ORM\ManyToOne(targetEntity: Campus::class, inversedBy: 'profiles')]
  81.     private ?\App\Entity\Campus $campus = null;
  82.     #[ORM\ManyToOne(targetEntity: Task::class, inversedBy: 'profiles')]
  83.     private ?\App\Entity\Task $task = null;
  84.     #[ORM\Column(type: 'date', nullable: true)]
  85.     private ?\DateTimeInterface $taskDate = null;
  86.     #[ORM\Column(type: 'integer', nullable: true, options: ['default' => 0])]
  87.     private ?int $taskStatus = null;
  88.     #[ORM\ManyToOne(targetEntity: Campus::class)]
  89.     private ?\App\Entity\Campus $campus1 = null;
  90.     #[ORM\ManyToOne(targetEntity: Campus::class)]
  91.     private ?\App\Entity\Campus $campus2 = null;
  92.     #[ORM\ManyToOne(targetEntity: Campus::class)]
  93.     private ?\App\Entity\Campus $campus3 = null;
  94.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  95.     private ?\App\Entity\Media $fileCv = null;
  96.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  97.     private ?\App\Entity\Media $fileLetter = null;
  98.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  99.     private ?\App\Entity\Media $fileReportCard1 = null;
  100.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  101.     private ?\App\Entity\Media $fileReportCard2 = null;
  102.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  103.     private ?\App\Entity\Media $fileReportCard3 = null;
  104.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  105.     private ?\App\Entity\Media $fileIdentity = null;
  106.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  107.     private ?\App\Entity\Media $fileResidencePermit = null;
  108.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  109.     private ?\App\Entity\Media $filePhoto = null;
  110.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  111.     private ?\App\Entity\Media $fileHandicap = null;
  112.     #[ORM\Column(type: 'date', nullable: true)]
  113.     private ?\DateTimeInterface $expireIdentity = null;
  114.     #[ORM\Column(type: 'date', nullable: true)]
  115.     private ?\DateTimeInterface $expireResidencePermit = null;
  116.     #[ORM\Column(type: 'text', nullable: true)]
  117.     private ?string $motivation = null;
  118.     #[ORM\Column(type: 'text', nullable: true)]
  119.     private ?string $admissionMessage = null;
  120.     #[ORM\ManyToOne(targetEntity: Cursus::class)]
  121.     private ?\App\Entity\Cursus $cursus = null;
  122.     #[ORM\Column(type: 'boolean', nullable: true)]
  123.     private ?bool $isHandicap = null;
  124.     #[ORM\Column(type: 'text', nullable: true)]
  125.     private ?string $handicapInfo = null;
  126.     public function __construct()
  127.     {
  128.         $this->programs = new ArrayCollection();
  129.         $this->profileFiles = new ArrayCollection();
  130.         $this->appointmentPerson = new ArrayCollection();
  131.         $this->profileNotes = new ArrayCollection();
  132.         $this->profileQcms = new ArrayCollection();
  133.         $this->openDayPeople = new ArrayCollection();
  134.         $this->notifications = new ArrayCollection();
  135.         $this->profileSources = new ArrayCollection();
  136.     }
  137.     public function getId(): ?int
  138.     {
  139.         return $this->id;
  140.     }
  141.     public function getUser(): ?User
  142.     {
  143.         return $this->user;
  144.     }
  145.     public function setUser(?User $user): self
  146.     {
  147.         $this->user = $user;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection<int, Program>
  152.      */
  153.     public function getPrograms(): Collection
  154.     {
  155.         return $this->programs;
  156.     }
  157.     public function addProgram(Program $program): self
  158.     {
  159.         if (!$this->programs->contains($program)) {
  160.             $this->programs[] = $program;
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeProgram(Program $program): self
  165.     {
  166.         $this->programs->removeElement($program);
  167.         return $this;
  168.     }
  169.     public function getSchoolName(): ?string
  170.     {
  171.         return $this->schoolName;
  172.     }
  173.     public function setSchoolName(?string $schoolName): self
  174.     {
  175.         $this->schoolName = $schoolName;
  176.         return $this;
  177.     }
  178.     public function getDiplomaName(): ?string
  179.     {
  180.         return $this->diplomaName;
  181.     }
  182.     public function setDiplomaName(?string $diplomaName): self
  183.     {
  184.         $this->diplomaName = $diplomaName;
  185.         return $this;
  186.     }
  187.     public function getStudyLevel(): ?StudyLevel
  188.     {
  189.         return $this->studyLevel;
  190.     }
  191.     public function setStudyLevel(?StudyLevel $studyLevel): self
  192.     {
  193.         $this->studyLevel = $studyLevel;
  194.         return $this;
  195.     }
  196.     public function getCommercial(): ?User
  197.     {
  198.         return $this->commercial;
  199.     }
  200.     public function setCommercial(?User $user): self
  201.     {
  202.         $this->commercial = $user;
  203.         return $this;
  204.     }
  205.     public function getEnglishLevel(): ?EnglishLevel
  206.     {
  207.         return $this->englishLevel;
  208.     }
  209.     public function setEnglishLevel(?EnglishLevel $englishLevel): self
  210.     {
  211.         $this->englishLevel = $englishLevel;
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return Collection<int, ProfileFile>
  216.      */
  217.     public function getProfileFiles(): Collection
  218.     {
  219.         return $this->profileFiles;
  220.     }
  221.     public function addProfileFile(ProfileFile $profileFile): self
  222.     {
  223.         if (!$this->profileFiles->contains($profileFile)) {
  224.             $this->profileFiles[] = $profileFile;
  225.             $profileFile->setProfile($this);
  226.         }
  227.         return $this;
  228.     }
  229.     public function removeProfileFile(ProfileFile $profileFile): self
  230.     {
  231.         if ($this->profileFiles->removeElement($profileFile)) {
  232.             // set the owning side to null (unless already changed)
  233.             if ($profileFile->getProfile() === $this) {
  234.                 $profileFile->setProfile(null);
  235.             }
  236.         }
  237.         return $this;
  238.     }
  239.     public function getJury(): ?Jury
  240.     {
  241.         return $this->jury;
  242.     }
  243.     public function setJury(?Jury $jury): self
  244.     {
  245.         $this->jury = $jury;
  246.         return $this;
  247.     }
  248.     public function getOraux(): ?Oraux
  249.     {
  250.         return $this->oraux;
  251.     }
  252.     public function setOraux(?Oraux $oraux): self
  253.     {
  254.         $this->oraux = $oraux;
  255.         return $this;
  256.     }
  257.     public function getStatus(): ?Status
  258.     {
  259.         return $this->status;
  260.     }
  261.     public function setStatus(?Status $status): self
  262.     {
  263.         $this->status = $status;
  264.         return $this;
  265.     }
  266.     public function getCampaign(): ?Campaign
  267.     {
  268.         return $this->campaign;
  269.     }
  270.     public function setCampaign(?Campaign $campaign): self
  271.     {
  272.         $this->campaign = $campaign;
  273.         return $this;
  274.     }
  275.     /**
  276.      * @return Collection<int, AppointmentPerson>
  277.      */
  278.     public function getAppointmentPerson(): Collection
  279.     {
  280.         return $this->appointmentPerson;
  281.     }
  282.     public function addAppointmentPerson(AppointmentPerson $appointmentPerson): self
  283.     {
  284.         if (!$this->appointmentPerson->contains($appointmentPerson)) {
  285.             $this->appointmentPerson[] = $appointmentPerson;
  286.             $appointmentPerson->setProfile($this);
  287.         }
  288.         return $this;
  289.     }
  290.     public function removeAppointmentPerson(AppointmentPerson $appointmentPerson): self
  291.     {
  292.         if ($this->appointmentPerson->removeElement($appointmentPerson)) {
  293.             // set the owning side to null (unless already changed)
  294.             if ($appointmentPerson->getProfile() === $this) {
  295.                 $appointmentPerson->setProfile(null);
  296.             }
  297.         }
  298.         return $this;
  299.     }
  300.     public function getSelectedProgram(): ?Program
  301.     {
  302.         return $this->selectedProgram;
  303.     }
  304.     public function setSelectedProgram(?Program $selectedProgram): self
  305.     {
  306.         $this->selectedProgram = $selectedProgram;
  307.         return $this;
  308.     }
  309.     public function getJuryResult(): ?array
  310.     {
  311.         return $this->juryResult;
  312.     }
  313.     public function setJuryResult(?array $juryResult): self
  314.     {
  315.         $this->juryResult = $juryResult;
  316.         return $this;
  317.     }
  318.     public function getJuryDate(): ?\DateTimeInterface
  319.     {
  320.         return $this->juryDate;
  321.     }
  322.     public function setJuryDate(?\DateTimeInterface $juryDate): self
  323.     {
  324.         $this->juryDate = $juryDate;
  325.         return $this;
  326.     }
  327.     public function getOrauxResult(): ?array
  328.     {
  329.         return $this->orauxResult;
  330.     }
  331.     public function setOrauxResult(?array $orauxResult): self
  332.     {
  333.         $this->orauxResult = $orauxResult;
  334.         return $this;
  335.     }
  336.     public function getOrauxDate(): ?\DateTimeInterface
  337.     {
  338.         return $this->orauxDate;
  339.     }
  340.     public function setOrauxDate(?\DateTimeInterface $orauxDate): self
  341.     {
  342.         $this->orauxDate = $orauxDate;
  343.         return $this;
  344.     }
  345.     /**
  346.      * @return Collection<int, ProfileNote>
  347.      */
  348.     public function getProfileNotes(): Collection
  349.     {
  350.         return $this->profileNotes;
  351.     }
  352.     public function addProfileNote(ProfileNote $profileNote): self
  353.     {
  354.         if (!$this->profileNotes->contains($profileNote)) {
  355.             $this->profileNotes[] = $profileNote;
  356.             $profileNote->setProfile($this);
  357.         }
  358.         return $this;
  359.     }
  360.     public function removeProfileNote(ProfileNote $profileNote): self
  361.     {
  362.         if ($this->profileNotes->removeElement($profileNote)) {
  363.             // set the owning side to null (unless already changed)
  364.             if ($profileNote->getProfile() === $this) {
  365.                 $profileNote->setProfile(null);
  366.             }
  367.         }
  368.         return $this;
  369.     }
  370.     public function getYear(): ?string
  371.     {
  372.         return $this->year;
  373.     }
  374.     public function setYear(?string $year): self
  375.     {
  376.         $this->year = $year;
  377.         return $this;
  378.     }
  379.     public function getPercent(): ?int
  380.     {
  381.         return $this->percent;
  382.     }
  383.     public function setPercent(?int $percent): self
  384.     {
  385.         $this->percent = $percent;
  386.         return $this;
  387.     }
  388.     public function getInformation(): ?array
  389.     {
  390.         return $this->information;
  391.     }
  392.     public function setInformation(?array $information): self
  393.     {
  394.         $this->information = $information;
  395.         return $this;
  396.     }
  397.     public function getMarketing(): ?array
  398.     {
  399.         return $this->marketing;
  400.     }
  401.     public function setMarketing(?array $marketing): self
  402.     {
  403.         $this->marketing = $marketing;
  404.         return $this;
  405.     }
  406.     public function getMediaChannel(): ?MediaChannel
  407.     {
  408.         return $this->mediaChannel;
  409.     }
  410.     public function setMediaChannel(?MediaChannel $mediaChannel): self
  411.     {
  412.         $this->mediaChannel = $mediaChannel;
  413.         return $this;
  414.     }
  415.     public function getLandingpage(): ?Landingpage
  416.     {
  417.         return $this->landingpage;
  418.     }
  419.     public function setLandingpage(?Landingpage $landingpage): self
  420.     {
  421.         $this->landingpage = $landingpage;
  422.         return $this;
  423.     }
  424.     /**
  425.      * @return Collection<int, ProfileQcm>
  426.      */
  427.     public function getProfileQcms(): Collection
  428.     {
  429.         return $this->profileQcms;
  430.     }
  431.     public function addProfileQcm(ProfileQcm $profileQcm): self
  432.     {
  433.         if (!$this->profileQcms->contains($profileQcm)) {
  434.             $this->profileQcms[] = $profileQcm;
  435.             $profileQcm->setProfile($this);
  436.         }
  437.         return $this;
  438.     }
  439.     public function removeProfileQcm(ProfileQcm $profileQcm): self
  440.     {
  441.         if ($this->profileQcms->removeElement($profileQcm)) {
  442.             // set the owning side to null (unless already changed)
  443.             if ($profileQcm->getProfile() === $this) {
  444.                 $profileQcm->setProfile(null);
  445.             }
  446.         }
  447.         return $this;
  448.     }
  449.     public function getTypeFormation(): ?int
  450.     {
  451.         return $this->typeFormation;
  452.     }
  453.     public function setTypeFormation(?int $typeFormation): self
  454.     {
  455.         $this->typeFormation = $typeFormation;
  456.         return $this;
  457.     }
  458.     public function getHostCompany(): ?string
  459.     {
  460.         return $this->hostCompany;
  461.     }
  462.     public function setHostCompany(?string $hostCompany): self
  463.     {
  464.         $this->hostCompany = $hostCompany;
  465.         return $this;
  466.     }
  467.     /**
  468.      * @return Collection<int, OpenDayPerson>
  469.      */
  470.     public function getOpenDayPeople(): Collection
  471.     {
  472.         return $this->openDayPeople;
  473.     }
  474.     public function addOpenDayPerson(OpenDayPerson $openDayPerson): self
  475.     {
  476.         if (!$this->openDayPeople->contains($openDayPerson)) {
  477.             $this->openDayPeople[] = $openDayPerson;
  478.             $openDayPerson->setProfile($this);
  479.         }
  480.         return $this;
  481.     }
  482.     public function removeOpenDayPerson(OpenDayPerson $openDayPerson): self
  483.     {
  484.         if ($this->openDayPeople->removeElement($openDayPerson)) {
  485.             // set the owning side to null (unless already changed)
  486.             if ($openDayPerson->getProfile() === $this) {
  487.                 $openDayPerson->setProfile(null);
  488.             }
  489.         }
  490.         return $this;
  491.     }
  492.     public function getCampus(): ?Campus
  493.     {
  494.         return $this->campus;
  495.     }
  496.     public function setCampus(?Campus $campus): self
  497.     {
  498.         $this->campus = $campus;
  499.         return $this;
  500.     }
  501.     public function getTask(): ?Task
  502.     {
  503.         return $this->task;
  504.     }
  505.     public function setTask(?Task $task): self
  506.     {
  507.         $this->task = $task;
  508.         return $this;
  509.     }
  510.     public function getTaskDate(): ?\DateTimeInterface
  511.     {
  512.         return $this->taskDate;
  513.     }
  514.     public function setTaskDate(?\DateTimeInterface $taskDate): self
  515.     {
  516.         $this->taskDate = $taskDate;
  517.         return $this;
  518.     }
  519.     public function getTaskStatus(): ?int
  520.     {
  521.         return $this->taskStatus;
  522.     }
  523.     public function setTaskStatus(?int $taskStatus): self
  524.     {
  525.         $this->taskStatus = $taskStatus;
  526.         return $this;
  527.     }
  528.     public function getCampus1(): ?Campus
  529.     {
  530.         return $this->campus1;
  531.     }
  532.     public function setCampus1(?Campus $campus1): self
  533.     {
  534.         $this->campus1 = $campus1;
  535.         return $this;
  536.     }
  537.     public function getCampus2(): ?Campus
  538.     {
  539.         return $this->campus2;
  540.     }
  541.     public function setCampus2(?Campus $campus2): self
  542.     {
  543.         $this->campus2 = $campus2;
  544.         return $this;
  545.     }
  546.     public function getCampus3(): ?Campus
  547.     {
  548.         return $this->campus3;
  549.     }
  550.     public function setCampus3(?Campus $campus3): self
  551.     {
  552.         $this->campus3 = $campus3;
  553.         return $this;
  554.     }
  555.     public function getFileCv(): ?Media
  556.     {
  557.         return $this->fileCv;
  558.     }
  559.     public function setFileCv(?Media $fileCv): self
  560.     {
  561.         $this->fileCv = $fileCv;
  562.         return $this;
  563.     }
  564.     public function getFileLetter(): ?Media
  565.     {
  566.         return $this->fileLetter;
  567.     }
  568.     public function setFileLetter(?Media $fileLetter): self
  569.     {
  570.         $this->fileLetter = $fileLetter;
  571.         return $this;
  572.     }
  573.     public function getFileReportCard1(): ?Media
  574.     {
  575.         return $this->fileReportCard1;
  576.     }
  577.     public function setFileReportCard1(?Media $fileReportCard1): self
  578.     {
  579.         $this->fileReportCard1 = $fileReportCard1;
  580.         return $this;
  581.     }
  582.     public function getFileReportCard2(): ?Media
  583.     {
  584.         return $this->fileReportCard2;
  585.     }
  586.     public function setFileReportCard2(?Media $fileReportCard2): self
  587.     {
  588.         $this->fileReportCard2 = $fileReportCard2;
  589.         return $this;
  590.     }
  591.     public function getFileReportCard3(): ?Media
  592.     {
  593.         return $this->fileReportCard3;
  594.     }
  595.     public function setFileReportCard3(?Media $fileReportCard3): self
  596.     {
  597.         $this->fileReportCard3 = $fileReportCard3;
  598.         return $this;
  599.     }
  600.     public function getFileIdentity(): ?Media
  601.     {
  602.         return $this->fileIdentity;
  603.     }
  604.     public function setFileIdentity(?Media $fileIdentity): self
  605.     {
  606.         $this->fileIdentity = $fileIdentity;
  607.         return $this;
  608.     }
  609.     public function getFileResidencePermit(): ?Media
  610.     {
  611.         return $this->fileResidencePermit;
  612.     }
  613.     public function setFileResidencePermit(?Media $fileResidencePermit): self
  614.     {
  615.         $this->fileResidencePermit = $fileResidencePermit;
  616.         return $this;
  617.     }
  618.     public function getFilePhoto(): ?Media
  619.     {
  620.         return $this->filePhoto;
  621.     }
  622.     public function setFilePhoto(?Media $filePhoto): self
  623.     {
  624.         $this->filePhoto = $filePhoto;
  625.         return $this;
  626.     }
  627.     public function getFileHandicap(): ?Media
  628.     {
  629.         return $this->fileHandicap;
  630.     }
  631.     public function setFileHandicap(?Media $fileHandicap): self
  632.     {
  633.         $this->fileHandicap = $fileHandicap;
  634.         return $this;
  635.     }
  636.     public function getExpireIdentity(): ?\DateTimeInterface
  637.     {
  638.         return $this->expireIdentity;
  639.     }
  640.     public function setExpireIdentity(?\DateTimeInterface $expireIdentity): self
  641.     {
  642.         $this->expireIdentity = $expireIdentity;
  643.         return $this;
  644.     }
  645.     public function getExpireResidencePermit(): ?\DateTimeInterface
  646.     {
  647.         return $this->expireResidencePermit;
  648.     }
  649.     public function setExpireResidencePermit(?\DateTimeInterface $expireResidencePermit): self
  650.     {
  651.         $this->expireResidencePermit = $expireResidencePermit;
  652.         return $this;
  653.     }
  654.     public function getMotivation(): ?string
  655.     {
  656.         return $this->motivation;
  657.     }
  658.     public function setMotivation(?string $motivation): self
  659.     {
  660.         $this->motivation = $motivation;
  661.         return $this;
  662.     }
  663.     public function getAdmissionMessage(): ?string
  664.     {
  665.         return $this->admissionMessage;
  666.     }
  667.     public function setAdmissionMessage(?string $admissionMessage): self
  668.     {
  669.         $this->admissionMessage = $admissionMessage;
  670.         return $this;
  671.     }
  672.     public function getCursus(): ?Cursus
  673.     {
  674.         return $this->cursus;
  675.     }
  676.     public function setCursus(?Cursus $cursus): self
  677.     {
  678.         $this->cursus = $cursus;
  679.         return $this;
  680.     }
  681.     public function getIsHandicap(): ?bool
  682.     {
  683.         return $this->isHandicap;
  684.     }
  685.     public function setIsHandicap(?bool $isHandicap): self
  686.     {
  687.         $this->isHandicap = $isHandicap;
  688.         return $this;
  689.     }
  690.     public function getHandicapInfo(): ?string
  691.     {
  692.         return $this->handicapInfo;
  693.     }
  694.     public function setHandicapInfo(?string $handicapInfo): self
  695.     {
  696.         $this->handicapInfo = $handicapInfo;
  697.         return $this;
  698.     }
  699.     public function calculateProfilePercent()
  700.     {
  701.         $percent = 25;
  702.         $info = $this->getInformation();
  703.         if (
  704.             !empty($this->getStudyLevel())
  705.             || (!empty($info)
  706.                 && (!empty($info['previousSchool'])
  707.                     || !empty($info['previousDegree'])
  708.                     || !empty($info['previousDegreeYear'])
  709.                     || !empty($info['previousDegreeDescription'])
  710.                     || !empty($info['currentDegree'])
  711.                     || !empty($info['currentDegreeYear'])
  712.                     || !empty($info['currentDegreeDescription'])
  713.                 )
  714.             )
  715.         ) {
  716.             $percent += 25;
  717.         }
  718.         if (!empty($this->getFileCv())) {
  719.             $percent += 25;
  720.         }
  721.         if (
  722.             !empty($this->getFileReportCard1())
  723.             || !empty($this->getFileReportCard2())
  724.             || !empty($this->getFileReportCard3())
  725.             || !empty($this->getFileIdentity())
  726.             || !empty($this->getFileResidencePermit())
  727.             || !empty($this->getFilePhoto())
  728.             || !empty($this->getFileHandicap())
  729.             || !empty($this->getFileReportCard2())
  730.             || !empty($this->getFileReportCard2())
  731.         ) {
  732.             $percent += 25;
  733.         }
  734.         $this->setPercent($percent);
  735.     }
  736.     #[ORM\Column(type: 'datetime', nullable: true)]
  737.     private \DateTimeInterface|null|\DateTime $createdDate = null;
  738.     #[ORM\Column(type: 'datetime', nullable: true)]
  739.     private $updatedDate;
  740.     #[ORM\Column(type: 'json', nullable: true)]
  741.     private ?array $entreprise = [];
  742.     #[ORM\Column(type: 'json', nullable: true)]
  743.     private ?array $contract = [];
  744.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  745.     private ?string $ficheEmail = null;
  746.     #[ORM\OneToMany(targetEntity: Notification::class, mappedBy: 'profile', orphanRemoval: true, cascade: ['persist', 'remove'])]
  747.     private Collection $notifications;
  748.     #[ORM\Column(type: 'json', nullable: true)]
  749.     private ?array $qcmResults = [];
  750.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  751.     private ?string $qcmToken = null;
  752.     #[ORM\Column(type: 'boolean', nullable: true)]
  753.     private ?bool $isDuplicate = null;
  754.     #[ORM\Column(type: 'boolean', nullable: true)]
  755.     private ?bool $repay = null;
  756.     #[ORM\Column(type: 'datetime', nullable: true)]
  757.     private ?\DateTimeInterface $abandonDate = null;
  758.     #[ORM\Column(type: 'text', nullable: true)]
  759.     private ?string $abandonNote = null;
  760.     #[ORM\Column(type: 'integer', nullable: true)]
  761.     private ?int $paymentMethod = null;
  762.     #[ORM\Column(type: 'datetime', nullable: true)]
  763.     private ?\DateTimeInterface $paymentDate = null;
  764.     #[ORM\Column(type: 'integer', nullable: true)]
  765.     private ?int $qcmMethod = null;
  766.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  767.     private ?\App\Entity\Media $fileDiplome = null;
  768.     // Tri-state: null = step4 never submitted, false/0 = submitted, campus email pending, true/1 = submitted and campus email sent.
  769.     #[ORM\Column(nullable: true)]
  770.     private ?bool $isSent = null;
  771.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  772.     private ?\DateTimeInterface $enrolledDate = null;
  773.     #[ORM\Column(nullable: true)]
  774.     private ?int $trainingOption = null;
  775.     #[ORM\Column(nullable: true)]
  776.     private ?int $primo = null;
  777.     #[ORM\Column(nullable: true)]
  778.     private ?bool $isAgent = null;
  779.     #[ORM\OneToOne(targetEntity: Media::class, cascade: ['persist', 'remove'])]
  780.     private ?\App\Entity\Media $fileSupportDocument = null;
  781.     #[ORM\OneToMany(mappedBy: 'profile', targetEntity: ProfileSource::class, orphanRemoval: true, cascade: ['persist', 'remove'])]
  782.     private Collection $profileSources;
  783.     #[ORM\OneToOne(cascade: ['persist', 'remove'])]
  784.     private ?Media $fileContract = null;
  785.     public function getCreatedDate(): ?\DateTimeInterface
  786.     {
  787.         return $this->createdDate;
  788.     }
  789.     public function setCreatedDate(?\DateTimeInterface $createdDate): self
  790.     {
  791.         $this->createdDate = $createdDate;
  792.         return $this;
  793.     }
  794.     public function getUpdatedDate(): ?\DateTimeInterface
  795.     {
  796.         return $this->updatedDate;
  797.     }
  798.     public function setUpdatedDate(?\DateTimeInterface $updatedDate): self
  799.     {
  800.         $this->updatedDate = $updatedDate;
  801.         return $this;
  802.     }
  803.     /**
  804.      * Gets triggered only on insert
  805.      */
  806.     #[ORM\PrePersist]
  807.     public function onPrePersist()
  808.     {
  809.         if (!$this->createdDate) {
  810.             $this->createdDate = new \DateTime('now');
  811.         }
  812.         if (!$this->updatedDate) {
  813.             $this->updatedDate = $this->createdDate;
  814.         }
  815.         $this->calculateProfilePercent();
  816.     }
  817.     /**
  818.      * Gets triggered every time on update
  819.      */
  820.     #[ORM\PreUpdate]
  821.     public function onPreUpdate()
  822.     {
  823.         $this->updatedDate = new \DateTime("now");
  824.         $this->calculateProfilePercent();
  825.     }
  826.     public function getEntreprise(): ?array
  827.     {
  828.         return $this->entreprise;
  829.     }
  830.     public function setEntreprise(?array $entreprise): self
  831.     {
  832.         $this->entreprise = $entreprise;
  833.         return $this;
  834.     }
  835.     public function getContract(): ?array
  836.     {
  837.         return $this->contract;
  838.     }
  839.     public function setContract(?array $contract): self
  840.     {
  841.         $this->contract = $contract;
  842.         return $this;
  843.     }
  844.     public function getFicheEmail(): ?string
  845.     {
  846.         return $this->ficheEmail;
  847.     }
  848.     public function setFicheEmail(?string $ficheEmail): self
  849.     {
  850.         $this->ficheEmail = $ficheEmail;
  851.         return $this;
  852.     }
  853.     /**
  854.      * @return Collection<int, Notification>
  855.      */
  856.     public function getNotifications(): Collection
  857.     {
  858.         return $this->notifications;
  859.     }
  860.     public function addNotification(Notification $notification): self
  861.     {
  862.         if (!$this->notifications->contains($notification)) {
  863.             $this->notifications[] = $notification;
  864.             $notification->setProfile($this);
  865.         }
  866.         return $this;
  867.     }
  868.     public function removeNotification(Notification $notification): self
  869.     {
  870.         if ($this->notifications->removeElement($notification)) {
  871.             // set the owning side to null (unless already changed)
  872.             if ($notification->getProfile() === $this) {
  873.                 $notification->setProfile(null);
  874.             }
  875.         }
  876.         return $this;
  877.     }
  878.     public function getQcmResults(): ?array
  879.     {
  880.         return $this->qcmResults;
  881.     }
  882.     public function setQcmResults(?array $qcmResults): self
  883.     {
  884.         $this->qcmResults = $qcmResults;
  885.         return $this;
  886.     }
  887.     public function getQcmToken(): ?string
  888.     {
  889.         return $this->qcmToken;
  890.     }
  891.     public function setQcmToken(?string $qcmToken): self
  892.     {
  893.         $this->qcmToken = $qcmToken;
  894.         return $this;
  895.     }
  896.     public function getIsDuplicate(): ?bool
  897.     {
  898.         return $this->isDuplicate;
  899.     }
  900.     public function setIsDuplicate(?bool $isDuplicate): self
  901.     {
  902.         $this->isDuplicate = $isDuplicate;
  903.         return $this;
  904.     }
  905.     public function getRepay(): ?bool
  906.     {
  907.         return $this->repay;
  908.     }
  909.     public function setRepay(?bool $repay): self
  910.     {
  911.         $this->repay = $repay;
  912.         return $this;
  913.     }
  914.     public function getAbandonDate(): ?\DateTimeInterface
  915.     {
  916.         return $this->abandonDate;
  917.     }
  918.     public function setAbandonDate(?\DateTimeInterface $abandonDate): self
  919.     {
  920.         $this->abandonDate = $abandonDate;
  921.         return $this;
  922.     }
  923.     public function getAbandonNote(): ?string
  924.     {
  925.         return $this->abandonNote;
  926.     }
  927.     public function setAbandonNote(?string $abandonNote): self
  928.     {
  929.         $this->abandonNote = $abandonNote;
  930.         return $this;
  931.     }
  932.     public function getPaymentMethod(): ?int
  933.     {
  934.         return $this->paymentMethod;
  935.     }
  936.     public function setPaymentMethod(?int $paymentMethod): self
  937.     {
  938.         $this->paymentMethod = $paymentMethod;
  939.         return $this;
  940.     }
  941.     public function getPaymentDate(): ?\DateTimeInterface
  942.     {
  943.         return $this->paymentDate;
  944.     }
  945.     public function setPaymentDate(?\DateTimeInterface $paymentDate): self
  946.     {
  947.         $this->paymentDate = $paymentDate;
  948.         return $this;
  949.     }
  950.     public function getQcmMethod(): ?int
  951.     {
  952.         return $this->qcmMethod;
  953.     }
  954.     public function setQcmMethod(?int $qcmMethod): self
  955.     {
  956.         $this->qcmMethod = $qcmMethod;
  957.         return $this;
  958.     }
  959.     public function getFileDiplome(): ?Media
  960.     {
  961.         return $this->fileDiplome;
  962.     }
  963.     public function setFileDiplome(?Media $fileDiplome): self
  964.     {
  965.         $this->fileDiplome = $fileDiplome;
  966.         return $this;
  967.     }
  968.     public function isIsSent(): ?bool
  969.     {
  970.         return $this->isSent;
  971.     }
  972.     public function setIsSent(?bool $isSent): static
  973.     {
  974.         $this->isSent = $isSent;
  975.         return $this;
  976.     }
  977.     public function getEnrolledDate(): ?\DateTimeInterface
  978.     {
  979.         return $this->enrolledDate;
  980.     }
  981.     public function setEnrolledDate(?\DateTimeInterface $enrolledDate): static
  982.     {
  983.         $this->enrolledDate = $enrolledDate;
  984.         return $this;
  985.     }
  986.     public function getTrainingOption(): ?int
  987.     {
  988.         return $this->trainingOption;
  989.     }
  990.     public function setTrainingOption(?int $trainingOption): static
  991.     {
  992.         $this->trainingOption = $trainingOption;
  993.         return $this;
  994.     }
  995.     public function getPrimo(): ?int
  996.     {
  997.         return $this->primo;
  998.     }
  999.     public function setPrimo(?int $primo): static
  1000.     {
  1001.         $this->primo = $primo;
  1002.         return $this;
  1003.     }
  1004.     public function isIsAgent(): ?bool
  1005.     {
  1006.         return $this->isAgent;
  1007.     }
  1008.     public function setIsAgent(?bool $isAgent): static
  1009.     {
  1010.         $this->isAgent = $isAgent;
  1011.         return $this;
  1012.     }
  1013.     public function getFileSupportDocument(): ?Media
  1014.     {
  1015.         return $this->fileSupportDocument;
  1016.     }
  1017.     public function setFileSupportDocument(?Media $fileSupportDocument): static
  1018.     {
  1019.         $this->fileSupportDocument = $fileSupportDocument;
  1020.         return $this;
  1021.     }
  1022.     /**
  1023.      * @return Collection<int, ProfileSource>
  1024.      */
  1025.     public function getProfileSources(): Collection
  1026.     {
  1027.         return $this->profileSources;
  1028.     }
  1029.     public function addProfileSource(ProfileSource $profileSource): static
  1030.     {
  1031.         if (!$this->profileSources->contains($profileSource)) {
  1032.             $this->profileSources->add($profileSource);
  1033.             $profileSource->setProfile($this);
  1034.         }
  1035.         return $this;
  1036.     }
  1037.     public function removeProfileSource(ProfileSource $profileSource): static
  1038.     {
  1039.         if ($this->profileSources->removeElement($profileSource)) {
  1040.             // set the owning side to null (unless already changed)
  1041.             if ($profileSource->getProfile() === $this) {
  1042.                 $profileSource->setProfile(null);
  1043.             }
  1044.         }
  1045.         return $this;
  1046.     }
  1047.     public function getFileContract(): ?Media
  1048.     {
  1049.         return $this->fileContract;
  1050.     }
  1051.     public function setFileContract(?Media $fileContract): static
  1052.     {
  1053.         $this->fileContract = $fileContract;
  1054.         return $this;
  1055.     }
  1056. }