src/Entity/Gestiform/Admin/Etablissement.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gestiform\Admin;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Adresse;
  5. use App\Entity\Common\Convention;
  6. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  7. use App\Entity\Gestiform\Users\Employe;
  8. use App\Repository\Gestiform\Admin\EtablissementRepository;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\DBAL\Types\Types;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. /**
  16.  * @ORM\Entity(repositoryClass=EtablissementRepository::class)
  17.  * @UniqueEntity(fields={"siret"}, message="Le SIRET doit ĂȘtre unique.")
  18.  */
  19. class Etablissement extends AbstractEntity
  20. {
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private ?string $intitule null;
  25.     /**
  26.      * @ORM\Column(type="string", length=14, unique=true, nullable=true)
  27.      * @Assert\Regex(
  28.      * pattern="/^[0-9]{14}$/",
  29.      * message="Le SIRET doit contenir exactement 14 chiffres."
  30.      * )
  31.      */
  32.     private ?string $siret null;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private ?string $numecole null;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private ?string $noUAI null;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=Adresse::class,  cascade={"persist"})
  43.      */
  44.     private ?Adresse $adresse null;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=Masterlistelg::class, cascade={"persist"})
  47.      * @ORM\JoinColumn(nullable=true)
  48.      */
  49.     private ?Masterlistelg $typeAdresse null;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=Tiers::class, inversedBy="etablissements",  cascade={"persist"})
  52.      */
  53.     private ?Tiers $tiers null;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity=Employe::class)
  56.      * @ORM\JoinColumn(nullable=true)
  57.      */
  58.     private ?Employe $referentHandicap null;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity=Convention::class, mappedBy="etablissement", cascade={"all"})
  61.      */
  62.     private Collection $conventions;
  63.     public function __construct()
  64.     {
  65.         $this->conventions = new ArrayCollection();
  66.     }
  67.     public function getReferentHandicap(): ?Employe
  68.     {
  69.         return $this->referentHandicap;
  70.     }
  71.     public function setReferentHandicap(?Employe $referentHandicap): self
  72.     {
  73.         $this->referentHandicap $referentHandicap;
  74.         return $this;
  75.     }
  76.     public function getIntitule(): ?string
  77.     {
  78.         return $this->intitule;
  79.     }
  80.     public function setIntitule(?string $intitule): self
  81.     {
  82.         $this->intitule $intitule;
  83.         return $this;
  84.     }
  85.     public function getSiret(): ?string
  86.     {
  87.         return $this->siret;
  88.     }
  89.     public function setSiret(?string $siret): self
  90.     {
  91.         $this->siret $siret;
  92.         return $this;
  93.     }
  94.     public function getNumecole(): ?string
  95.     {
  96.         return $this->numecole;
  97.     }
  98.     public function setNumecole(?string $numecole): self
  99.     {
  100.         $this->numecole $numecole;
  101.         return $this;
  102.     }
  103.     public function getAdresse(): ?Adresse
  104.     {
  105.         return $this->adresse;
  106.     }
  107.     public function setAdresse(?Adresse $adresse): self
  108.     {
  109.         $this->adresse $adresse;
  110.         return $this;
  111.     }
  112.     public function getTiers(): ?Tiers
  113.     {
  114.         return $this->tiers;
  115.     }
  116.     public function setTiers(?Tiers $tiers): self
  117.     {
  118.         $this->tiers $tiers;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, Convention>
  123.      */
  124.     public function getConventions(): Collection
  125.     {
  126.         return $this->conventions;
  127.     }
  128.     public function addConvention(Convention $convention): self
  129.     {
  130.         if (!$this->conventions->contains($convention)) {
  131.             $this->conventions->add($convention);
  132.             $convention->setEtablissement($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeConvention(Convention $convention): self
  137.     {
  138.         if ($this->conventions->removeElement($convention)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($convention->getEtablissement() === $this) {
  141.                 $convention->setEtablissement(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function getNoUAI(): ?string
  147.     {
  148.         return $this->noUAI;
  149.     }
  150.     public function setNoUAI(?string $noUAI): self
  151.     {
  152.         $this->noUAI $noUAI;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Masterlistelg|null
  157.      */
  158.     public function getTypeAdresse(): ?Masterlistelg
  159.     {
  160.         return $this->typeAdresse;
  161.     }
  162.     /**
  163.      * @param Masterlistelg|null $typeAdresse
  164.      * @return Etablissement
  165.      */
  166.     public function setTypeAdresse(?Masterlistelg $typeAdresse): self
  167.     {
  168.         $this->typeAdresse $typeAdresse;
  169.         return $this;
  170.     }
  171. }