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\Entretien\CVdynamique;
  7. use App\Entity\Gestiform\Admin\Entretien\Entretien;
  8. use App\Entity\Gestiform\Formations\Dossier\DossierQuiz;
  9. use App\Entity\Gestiform\Formations\Dossier\PersonalInformations;
  10. use App\Repository\Gestiform\Users\PersonneRepository;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Doctrine\ORM\Mapping as ORM;
  14. #[ORM\Entity(repositoryClassPersonneRepository::class)]
  15. class Personne extends User
  16. {
  17.     #[ORM\JoinColumn(nullabletrue)]
  18.     #[ORM\ManyToOne(targetEntityPersonalInformations::class, cascade: ['all'])]
  19.     private ?PersonalInformations $personalInformations null;
  20.     #[ORM\OneToMany(mappedBy'personne'targetEntityHistoriqueEmail::class, cascade: ['persist'])]
  21.     private Collection $historiqueEmails;
  22.     #[ORM\OneToMany(mappedBy'personne'targetEntityDocument::class, cascade: ['persist'])]
  23.     private Collection $documents;
  24.     #[ORM\OneToMany(mappedBy'personne'targetEntityCVdynamique::class, cascade: ['persist'])]
  25.     private Collection $cvDynamiques;
  26.     #[ORM\OneToMany(mappedBy'personne'targetEntityEntretien::class, cascade: ['persist'])]
  27.     private Collection $entretiens;
  28.     #[ORM\JoinColumn(nullabletrue)]
  29.     #[ORM\OneToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  30.     private ?Upload $signatureFile null;
  31.     #[ORM\OneToMany(mappedBy'personne'targetEntityDossierQuiz::class, cascade: ['all'])]
  32.     private Collection $personneQuizzs;
  33.     public function __construct()
  34.     {
  35.         $this->documents = new ArrayCollection();
  36.         $this->historiqueEmails = new ArrayCollection();
  37.         $this->cvDynamiques = new ArrayCollection();
  38.         $this->entretiens = new ArrayCollection();
  39.         $this->personneQuizzs = new ArrayCollection();
  40.     }
  41.     public function getPersonalInformations(): ?PersonalInformations
  42.     {
  43.         return $this->personalInformations;
  44.     }
  45.     public function setPersonalInformations(?PersonalInformations $personalInformations): self
  46.     {
  47.         $this->personalInformations $personalInformations;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, HistoriqueEmail>
  52.      */
  53.     public function getHistoriqueEmails(): Collection
  54.     {
  55.         return $this->historiqueEmails;
  56.     }
  57.     public function addHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  58.     {
  59.         if (!$this->historiqueEmails->contains($historiqueEmail)) {
  60.             $this->historiqueEmails->add($historiqueEmail);
  61.             $historiqueEmail->setPersonne($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  66.     {
  67.         // set the owning side to null (unless already changed)
  68.         if ($this->historiqueEmails->removeElement($historiqueEmail) && $historiqueEmail->getPersonne() === $this) {
  69.             $historiqueEmail->setPersonne(null);
  70.         }
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, Document>
  75.      */
  76.     public function getDocuments(): Collection
  77.     {
  78.         return $this->documents;
  79.     }
  80.     public function addDocument(Document $document): self
  81.     {
  82.         if (!$this->documents->contains($document)) {
  83.             $this->documents->add($document);
  84.             $document->setPersonne($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeDocument(Document $document): self
  89.     {
  90.         // set the owning side to null (unless already changed)
  91.         if ($this->documents->removeElement($document) && $document->getPersonne() === $this) {
  92.             $document->setPersonne(null);
  93.         }
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, CVdynamique>
  98.      */
  99.     public function getCVDynamiques(): Collection
  100.     {
  101.         return $this->cvDynamiques;
  102.     }
  103.     public function addCVDynamique(CVdynamique $cvDynamique): self
  104.     {
  105.         if (!$this->cvDynamiques->contains($cvDynamique)) {
  106.             $this->cvDynamiques->add($cvDynamique);
  107.             $cvDynamique->setPersonne($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeCVDynamique(CVdynamique $cVDynamique): self
  112.     {
  113.         // set the owning side to null (unless already changed)
  114.         if ($this->$cVDynamique->removeElement($cVDynamique) && $cVDynamique->getPersonne() === $this) {
  115.             $cVDynamique->setPersonne(null);
  116.         }
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, Entretien>
  121.      */
  122.     public function getEntretiens(): Collection
  123.     {
  124.         return $this->entretiens;
  125.     }
  126.     public function addEntretien(Entretien $entretien): self
  127.     {
  128.         if (!$this->entretiens->contains($entretien)) {
  129.             $this->entretiens->add($entretien);
  130.             $entretien->setPersonne($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removeEntretien(Entretien $entretien): self
  135.     {
  136.         // set the owning side to null (unless already changed)
  137.         if ($this->entretiens->removeElement($entretien) && $entretien->getPersonne() === $this) {
  138.             $entretien->setPersonne(null);
  139.         }
  140.         return $this;
  141.     }
  142.     public function getSignatureFile(): ?Upload
  143.     {
  144.         return $this->signatureFile;
  145.     }
  146.     public function setSignatureFile(?Upload $signatureFile): self
  147.     {
  148.         $this->signatureFile $signatureFile;
  149.         return $this;
  150.     }
  151.     /**
  152.      * @return Collection<int, DossierQuiz>
  153.      */
  154.     public function getPersonneQuizzs(): Collection
  155.     {
  156.         return $this->personneQuizzs;
  157.     }
  158.     public function addPersonneQuizz(DossierQuiz $personneQuizz): static
  159.     {
  160.         if (!$this->personneQuizzs->contains($personneQuizz)) {
  161.             $this->personneQuizzs->add($personneQuizz);
  162.             $personneQuizz->setPersonne($this);
  163.         }
  164.         return $this;
  165.     }
  166.     public function removePersonneQuizz(DossierQuiz $personneQuizz): static
  167.     {
  168.         if ($this->personneQuizzs->removeElement($personneQuizz)) {
  169.             // set the owning side to null (unless already changed)
  170.             if ($personneQuizz->getPersonne() === $this) {
  171.                 $personneQuizz->setPersonne(null);
  172.             }
  173.         }
  174.         return $this;
  175.     }
  176. }