src/Domain/Entity/AsociacionEmpresarial.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. class AsociacionEmpresarial extends ConsortiumLaboral
  6. {
  7.     private Collection $hijos;
  8.     private Collection $documentacionAsociacionEmpresarials;
  9.     private ?self $padre null;
  10.     private Collection $sectors;
  11.     private Collection $sectores;
  12.     public function __construct()
  13.     {
  14.         $this->hijos = new ArrayCollection();
  15.         $this->documentacionAsociacionEmpresarials = new ArrayCollection();
  16.         $this->sectores = new ArrayCollection();
  17.     }
  18.     /**
  19.      * @return Collection<int, AsociacionEmpresarial>
  20.      */
  21.     public function getHijos(): Collection
  22.     {
  23.         return $this->hijos;
  24.     }
  25.     public function addHijo(AsociacionEmpresarial $hijo): static
  26.     {
  27.         if (!$this->hijos->contains($hijo)) {
  28.             $this->hijos->add($hijo);
  29.             $hijo->setPadre($this);
  30.         }
  31.         return $this;
  32.     }
  33.     public function removeHijo(AsociacionEmpresarial $hijo): static
  34.     {
  35.         if ($this->hijos->removeElement($hijo)) {
  36.             // set the owning side to null (unless already changed)
  37.             if ($hijo->getPadre() === $this) {
  38.                 $hijo->setPadre(null);
  39.             }
  40.         }
  41.         return $this;
  42.     }
  43.     /**
  44.      * @return Collection<int, DocumentacionAsociacionEmpresarial>
  45.      */
  46.     public function getDocumentacionAsociacionEmpresarials(): Collection
  47.     {
  48.         return $this->documentacionAsociacionEmpresarials;
  49.     }
  50.     public function addDocumentacionAsociacionEmpresarial(DocumentacionAsociacionEmpresarial $documentacionAsociacionEmpresarial): static
  51.     {
  52.         if (!$this->documentacionAsociacionEmpresarials->contains($documentacionAsociacionEmpresarial)) {
  53.             $this->documentacionAsociacionEmpresarials->add($documentacionAsociacionEmpresarial);
  54.             $documentacionAsociacionEmpresarial->setAsociacionEmpresarial($this);
  55.         }
  56.         return $this;
  57.     }
  58.     public function removeDocumentacionAsociacionEmpresarial(DocumentacionAsociacionEmpresarial $documentacionAsociacionEmpresarial): static
  59.     {
  60.         if ($this->documentacionAsociacionEmpresarials->removeElement($documentacionAsociacionEmpresarial)) {
  61.             // set the owning side to null (unless already changed)
  62.             if ($documentacionAsociacionEmpresarial->getAsociacionEmpresarial() === $this) {
  63.                 $documentacionAsociacionEmpresarial->setAsociacionEmpresarial(null);
  64.             }
  65.         }
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return Collection<int, SectorHasAsociacionEmpresarial>
  70.      */
  71.     public function getSectores(): Collection
  72.     {
  73.         return $this->sectores;
  74.     }
  75.     public function addSectore(SectorHasAsociacionEmpresarial $sectore): static
  76.     {
  77.         if (!$this->sectores->contains($sectore)) {
  78.             $this->sectores->add($sectore);
  79.             $sectore->setAsociacionEmpresarial($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeSectore(SectorHasAsociacionEmpresarial $sectore): static
  84.     {
  85.         if ($this->sectores->removeElement($sectore)) {
  86.             // set the owning side to null (unless already changed)
  87.             if ($sectore->getAsociacionEmpresarial() === $this) {
  88.                 $sectore->setAsociacionEmpresarial(null);
  89.             }
  90.         }
  91.         return $this;
  92.     }
  93.     public function getPadre(): ?self
  94.     {
  95.         return $this->padre;
  96.     }
  97.     public function setPadre(?self $padre): static
  98.     {
  99.         $this->padre $padre;
  100.         return $this;
  101.     }
  102. }