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