src/Entity/Gestiform/Users/Apprenant.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gestiform\Users;
  3. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  4. use App\Entity\Gestiform\Formations\Dossier\Dossier;
  5. use App\Entity\Gestiform\Formations\Entreprise\Contact;
  6. use App\Repository\Gestiform\Users\ApprenantRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11.  * @ORM\Entity(repositoryClass=ApprenantRepository::class)
  12.  */
  13. class Apprenant extends Personne
  14. {
  15.     /**
  16.      * @ORM\Column(type="boolean", nullable=true)
  17.      */
  18.     private ?bool $mineur false;
  19.     /**
  20.      * @ORM\OneToMany(targetEntity=Dossier::class, mappedBy="apprenant",cascade={"persist"})
  21.      */
  22.     private Collection $dossiers;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Dossier::class, cascade={"persist", "remove"})
  25.      * @ORM\JoinColumn(nullable=true)
  26.      */
  27.     private ?Dossier $dossierActif null;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Contact::class, cascade={"persist", "remove"})
  30.      * @ORM\JoinColumn(nullable=true)
  31.      */
  32.     private ?Contact $representantLegal null;
  33.     public function __construct()
  34.     {
  35.         parent::__construct();
  36.         $this->dossiers = new ArrayCollection();
  37.     }
  38.     public function getDossierActif(): ?Dossier
  39.     {
  40.         return $this->dossierActif;
  41.     }
  42.     public function setDossierActif(?Dossier $dossierActif): self
  43.     {
  44.         $this->dossierActif $dossierActif;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, Dossier>
  49.      */
  50.     public function getDossiers(): Collection
  51.     {
  52.         return $this->dossiers;
  53.     }
  54.     public function addDossier(Dossier $dossier): self
  55.     {
  56.         if (!$this->dossiers->contains($dossier)) {
  57.             $this->dossiers->add($dossier);
  58.             $dossier->setApprenant($this);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removeDossier(Dossier $dossier): self
  63.     {
  64.         if ($this->dossiers->removeElement($dossier)) {
  65.             // set the owning side to null (unless already changed)
  66.             if ($dossier->getApprenant() === $this) {
  67.                 $dossier->setApprenant(null);
  68.             }
  69.         }
  70.         return $this;
  71.     }
  72.     public function getMineur(): ?bool
  73.     {
  74.         return $this->mineur;
  75.     }
  76.     public function setMineur(?bool $mineur): self
  77.     {
  78.         $this->mineur $mineur;
  79.         return $this;
  80.     }
  81.     public function getRepresentantLegal(): ?Contact
  82.     {
  83.         return $this->representantLegal;
  84.     }
  85.     public function setRepresentantLegal(?Contact $representantLegal): self
  86.     {
  87.         $this->representantLegal $representantLegal;
  88.         return $this;
  89.     }
  90. }