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

Open in your IDE?
  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\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. /**
  15.  * @ORM\Entity(repositoryClass=PersonneRepository::class)
  16.  */
  17. class Personne extends User
  18. {
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=PersonalInformations::class,  cascade={"all"})
  21.      * @ORM\JoinColumn(nullable=true)
  22.      */
  23.     private ?PersonalInformations $personalInformations null;
  24.     /**
  25.      * @ORM\OneToMany(targetEntity=HistoriqueEmail::class, mappedBy="personne",cascade={"persist"})
  26.      */
  27.     private Collection $historiqueEmails;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity=Document::class, mappedBy="personne",cascade={"persist"})
  30.      */
  31.     private Collection $documents;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=CVdynamique::class, mappedBy="personne",cascade={"persist"})
  34.      */
  35.     private Collection $cvDynamiques;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=Entretien::class, mappedBy="personne",cascade={"persist"})
  38.      */
  39.     private Collection $entretiens;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=CursusReponses::class, mappedBy="personne",cascade={"persist"})
  42.      */
  43.     private Collection $reponses;
  44.     /**
  45.      * @ORM\JoinColumn(nullable=true)
  46.      * @ORM\OneToOne(targetEntity=Upload::class, cascade={"persist", "remove"})
  47.      */
  48.     private ?Upload $signatureFile null;
  49.     public function __construct()
  50.     {
  51.         $this->documents = new ArrayCollection();
  52.         $this->historiqueEmails = new ArrayCollection();
  53.         $this->cvDynamiques = new ArrayCollection();
  54.         $this->entretiens = new ArrayCollection();
  55.         $this->reponses = new ArrayCollection();
  56.     }
  57.     public function getPersonalInformations(): ?PersonalInformations
  58.     {
  59.         return $this->personalInformations;
  60.     }
  61.     public function setPersonalInformations(?PersonalInformations $personalInformations): self
  62.     {
  63.         $this->personalInformations $personalInformations;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, HistoriqueEmail>
  68.      */
  69.     public function getHistoriqueEmails(): Collection
  70.     {
  71.         return $this->historiqueEmails;
  72.     }
  73.     public function addHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  74.     {
  75.         if (!$this->historiqueEmails->contains($historiqueEmail)) {
  76.             $this->historiqueEmails->add($historiqueEmail);
  77.             $historiqueEmail->setPersonne($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  82.     {
  83.         if ($this->historiqueEmails->removeElement($historiqueEmail)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($historiqueEmail->getPersonne() === $this) {
  86.                 $historiqueEmail->setPersonne(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Document>
  93.      */
  94.     public function getDocuments(): Collection
  95.     {
  96.         return $this->documents;
  97.     }
  98.     public function addDocument(Document $document): self
  99.     {
  100.         if (!$this->documents->contains($document)) {
  101.             $this->documents->add($document);
  102.             $document->setPersonne($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeDocument(Document $document): self
  107.     {
  108.         if ($this->documents->removeElement($document)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($document->getPersonne() === $this) {
  111.                 $document->setPersonne(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return Collection<int, CVdynamique>
  118.      */
  119.     public function getCVDynamiques(): Collection
  120.     {
  121.         return $this->cvDynamiques;
  122.     }
  123.     public function addCVDynamique(CVdynamique $cvDynamique): self
  124.     {
  125.         if (!$this->cvDynamiques->contains($cvDynamique)) {
  126.             $this->cvDynamiques->add($cvDynamique);
  127.             $cvDynamique->setPersonne($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function removeCVDynamique(CVdynamique $cVDynamique): self
  132.     {
  133.         if ($this->$cVDynamique->removeElement($cVDynamique)) {
  134.             // set the owning side to null (unless already changed)
  135.             if ($cVDynamique->getPersonne() === $this) {
  136.                 $cVDynamique->setPersonne(null);
  137.             }
  138.         }
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return Collection<int, Entretien>
  143.      */
  144.     public function getEntretiens(): Collection
  145.     {
  146.         return $this->entretiens;
  147.     }
  148.     public function addEntretien(Entretien $entretien): self
  149.     {
  150.         if (!$this->entretiens->contains($entretien)) {
  151.             $this->entretiens->add($entretien);
  152.             $entretien->setPersonne($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function removeEntretien(Entretien $entretien): self
  157.     {
  158.         if ($this->entretiens->removeElement($entretien)) {
  159.             // set the owning side to null (unless already changed)
  160.             if ($entretien->getPersonne() === $this) {
  161.                 $entretien->setPersonne(null);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Collection<int, CursusReponses>
  168.      */
  169.     public function getCursusReponse(): Collection
  170.     {
  171.         return $this->reponses;
  172.     }
  173.     public function addCursusReponse(CursusReponses $reponse): self
  174.     {
  175.         if (!$this->reponses->contains($reponse)) {
  176.             $this->reponses->add($reponse);
  177.             $reponse->setPersonne($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeCursusReponse(CursusReponses $reponse): self
  182.     {
  183.         if ($this->reponses->removeElement($reponse)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($reponse->getPersonne() === $this) {
  186.                 $reponse->setPersonne(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191.     public function getSignatureFile(): ?Upload
  192.     {
  193.         return $this->signatureFile;
  194.     }
  195.     public function setSignatureFile(?Upload $signatureFile): self
  196.     {
  197.         $this->signatureFile $signatureFile;
  198.         return $this;
  199.     }
  200. }