src/Domain/Entity/MetadataCustomRegistro.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 MetadataCustomRegistro extends Metadata
  6. {
  7.     private ?Entidad $entidad null;
  8.     private Collection $customRegistros;
  9.     private Collection $entidades;
  10.     public function __construct()
  11.     {
  12.         parent::__construct();
  13.         $this->customRegistros = new ArrayCollection();
  14.         $this->entidades = new ArrayCollection();
  15.     }
  16.     public function getEntidad(): ?Entidad
  17.     {
  18.         return $this->entidad;
  19.     }
  20.     public function setEntidad(?Entidad $entidad): static
  21.     {
  22.         $this->entidad $entidad;
  23.         return $this;
  24.     }
  25.     /**
  26.      * @return Collection<int, CustomRegistro>
  27.      */
  28.     public function getCustomRegistros(): Collection
  29.     {
  30.         return $this->customRegistros;
  31.     }
  32.     public function addCustomRegistro(CustomRegistro $customRegistro): static
  33.     {
  34.         if (!$this->customRegistros->contains($customRegistro)) {
  35.             $this->customRegistros->add($customRegistro);
  36.             $customRegistro->setMetadata($this);
  37.         }
  38.         return $this;
  39.     }
  40.     public function removeCustomRegistro(CustomRegistro $customRegistro): static
  41.     {
  42.         if ($this->customRegistros->removeElement($customRegistro)) {
  43.             // set the owning side to null (unless already changed)
  44.             if ($customRegistro->getMetadata() === $this) {
  45.                 $customRegistro->setMetadata(null);
  46.             }
  47.         }
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, Entidad>
  52.      */
  53.     public function getEntidades(): Collection
  54.     {
  55.         return $this->entidades;
  56.     }
  57.     public function addEntidade(Entidad $entidade): static
  58.     {
  59.         if (!$this->entidades->contains($entidade)) {
  60.             $this->entidades->add($entidade);
  61.             $entidade->addMetadataCustomRegistrosEnabled($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeEntidade(Entidad $entidade): static
  66.     {
  67.         if ($this->entidades->removeElement($entidade)) {
  68.             $entidade->removeMetadataCustomRegistrosEnabled($this);
  69.         }
  70.         return $this;
  71.     }
  72. }