src/Entity/Gestiform/Users/Personne.php line 20

  1. <?php
  2. namespace App\Entity\Gestiform\Users;
  3. use App\Entity\Common\Document;
  4. use App\Entity\Common\HistoriqueEmail;
  5. use App\Entity\Common\Upload;
  6. use App\Entity\Gestiform\Admin\Cursus\CursusReponses;
  7. use App\Entity\Gestiform\Admin\Cursus\CVdynamique;
  8. use App\Entity\Gestiform\Admin\Cursus\Entretien;
  9. use App\Entity\Gestiform\Formations\Dossier\DossierQuiz;
  10. use App\Entity\Gestiform\Formations\Dossier\PersonalInformations;
  11. use App\Repository\Gestiform\Users\PersonneRepository;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. use Doctrine\ORM\Mapping as ORM;
  15. #[ORM\Entity(repositoryClassPersonneRepository::class)]
  16. class Personne extends User
  17. {
  18.     #[ORM\JoinColumn(nullabletrue)]
  19.     #[ORM\ManyToOne(targetEntityPersonalInformations::class, cascade: ['all'])]
  20.     private ?PersonalInformations $personalInformations null;
  21.     #[ORM\OneToMany(mappedBy'personne'targetEntityHistoriqueEmail::class, cascade: ['persist'])]
  22.     private Collection $historiqueEmails;
  23.     #[ORM\OneToMany(mappedBy'personne'targetEntityDocument::class, cascade: ['persist'])]
  24.     private Collection $documents;
  25.     #[ORM\OneToMany(mappedBy'personne'targetEntityCVdynamique::class, cascade: ['persist'])]
  26.     private Collection $cvDynamiques;
  27.     #[ORM\OneToMany(mappedBy'personne'targetEntityEntretien::class, cascade: ['persist'])]
  28.     private Collection $entretiens;
  29.     #[ORM\OneToMany(mappedBy'personne'targetEntityCursusReponses::class, cascade: ['persist'])]
  30.     private Collection $reponses;
  31.     #[ORM\JoinColumn(nullabletrue)]
  32.     #[ORM\OneToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  33.     private ?Upload $signatureFile null;
  34.     #[ORM\OneToMany(mappedBy'personne'targetEntityDossierQuiz::class, cascade: ['all'])]
  35.     private Collection $personneQuizzs;
  36.     public function __construct()
  37.     {
  38.         $this->documents = new ArrayCollection();
  39.         $this->historiqueEmails = new ArrayCollection();
  40.         $this->cvDynamiques = new ArrayCollection();
  41.         $this->entretiens = new ArrayCollection();
  42.         $this->reponses = new ArrayCollection();
  43.         $this->personneQuizzs = new ArrayCollection();
  44.     }
  45.     public function getPersonalInformations(): ?PersonalInformations
  46.     {
  47.         return $this->personalInformations;
  48.     }
  49.     public function setPersonalInformations(?PersonalInformations $personalInformations): self
  50.     {
  51.         $this->personalInformations $personalInformations;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return Collection<int, HistoriqueEmail>
  56.      */
  57.     public function getHistoriqueEmails(): Collection
  58.     {
  59.         return $this->historiqueEmails;
  60.     }
  61.     public function addHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  62.     {
  63.         if (!$this->historiqueEmails->contains($historiqueEmail)) {
  64.             $this->historiqueEmails->add($historiqueEmail);
  65.             $historiqueEmail->setPersonne($this);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removeHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  70.     {
  71.         // set the owning side to null (unless already changed)
  72.         if ($this->historiqueEmails->removeElement($historiqueEmail) && $historiqueEmail->getPersonne() === $this) {
  73.             $historiqueEmail->setPersonne(null);
  74.         }
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, Document>
  79.      */
  80.     public function getDocuments(): Collection
  81.     {
  82.         return $this->documents;
  83.     }
  84.     public function addDocument(Document $document): self
  85.     {
  86.         if (!$this->documents->contains($document)) {
  87.             $this->documents->add($document);
  88.             $document->setPersonne($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeDocument(Document $document): self
  93.     {
  94.         // set the owning side to null (unless already changed)
  95.         if ($this->documents->removeElement($document) && $document->getPersonne() === $this) {
  96.             $document->setPersonne(null);
  97.         }
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return Collection<int, CVdynamique>
  102.      */
  103.     public function getCVDynamiques(): Collection
  104.     {
  105.         return $this->cvDynamiques;
  106.     }
  107.     public function addCVDynamique(CVdynamique $cvDynamique): self
  108.     {
  109.         if (!$this->cvDynamiques->contains($cvDynamique)) {
  110.             $this->cvDynamiques->add($cvDynamique);
  111.             $cvDynamique->setPersonne($this);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeCVDynamique(CVdynamique $cVDynamique): self
  116.     {
  117.         // set the owning side to null (unless already changed)
  118.         if ($this->$cVDynamique->removeElement($cVDynamique) && $cVDynamique->getPersonne() === $this) {
  119.             $cVDynamique->setPersonne(null);
  120.         }
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, Entretien>
  125.      */
  126.     public function getEntretiens(): Collection
  127.     {
  128.         return $this->entretiens;
  129.     }
  130.     public function addEntretien(Entretien $entretien): self
  131.     {
  132.         if (!$this->entretiens->contains($entretien)) {
  133.             $this->entretiens->add($entretien);
  134.             $entretien->setPersonne($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeEntretien(Entretien $entretien): self
  139.     {
  140.         // set the owning side to null (unless already changed)
  141.         if ($this->entretiens->removeElement($entretien) && $entretien->getPersonne() === $this) {
  142.             $entretien->setPersonne(null);
  143.         }
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection<int, CursusReponses>
  148.      */
  149.     public function getCursusReponse(): Collection
  150.     {
  151.         return $this->reponses;
  152.     }
  153.     public function addCursusReponse(CursusReponses $reponse): self
  154.     {
  155.         if (!$this->reponses->contains($reponse)) {
  156.             $this->reponses->add($reponse);
  157.             $reponse->setPersonne($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeCursusReponse(CursusReponses $reponse): self
  162.     {
  163.         // set the owning side to null (unless already changed)
  164.         if ($this->reponses->removeElement($reponse) && $reponse->getPersonne() === $this) {
  165.             $reponse->setPersonne(null);
  166.         }
  167.         return $this;
  168.     }
  169.     public function getSignatureFile(): ?Upload
  170.     {
  171.         return $this->signatureFile;
  172.     }
  173.     public function setSignatureFile(?Upload $signatureFile): self
  174.     {
  175.         $this->signatureFile $signatureFile;
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return Collection<int, CursusReponses>
  180.      */
  181.     public function getReponses(): Collection
  182.     {
  183.         return $this->reponses;
  184.     }
  185.     public function addReponse(CursusReponses $reponse): static
  186.     {
  187.         if (!$this->reponses->contains($reponse)) {
  188.             $this->reponses->add($reponse);
  189.             $reponse->setPersonne($this);
  190.         }
  191.         return $this;
  192.     }
  193.     public function removeReponse(CursusReponses $reponse): static
  194.     {
  195.         if ($this->reponses->removeElement($reponse)) {
  196.             // set the owning side to null (unless already changed)
  197.             if ($reponse->getPersonne() === $this) {
  198.                 $reponse->setPersonne(null);
  199.             }
  200.         }
  201.         return $this;
  202.     }
  203.     /**
  204.      * @return Collection<int, DossierQuiz>
  205.      */
  206.     public function getPersonneQuizzs(): Collection
  207.     {
  208.         return $this->personneQuizzs;
  209.     }
  210.     public function addPersonneQuizz(DossierQuiz $personneQuizz): static
  211.     {
  212.         if (!$this->personneQuizzs->contains($personneQuizz)) {
  213.             $this->personneQuizzs->add($personneQuizz);
  214.             $personneQuizz->setPersonne($this);
  215.         }
  216.         return $this;
  217.     }
  218.     public function removePersonneQuizz(DossierQuiz $personneQuizz): static
  219.     {
  220.         if ($this->personneQuizzs->removeElement($personneQuizz)) {
  221.             // set the owning side to null (unless already changed)
  222.             if ($personneQuizz->getPersonne() === $this) {
  223.                 $personneQuizz->setPersonne(null);
  224.             }
  225.         }
  226.         return $this;
  227.     }
  228. }