<?php
namespace App\Domain\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
class MetadataCustomRegistro extends Metadata
{
private ?Entidad $entidad = null;
private Collection $customRegistros;
private Collection $entidades;
public function __construct()
{
parent::__construct();
$this->customRegistros = new ArrayCollection();
$this->entidades = new ArrayCollection();
}
public function getEntidad(): ?Entidad
{
return $this->entidad;
}
public function setEntidad(?Entidad $entidad): static
{
$this->entidad = $entidad;
return $this;
}
/**
* @return Collection<int, CustomRegistro>
*/
public function getCustomRegistros(): Collection
{
return $this->customRegistros;
}
public function addCustomRegistro(CustomRegistro $customRegistro): static
{
if (!$this->customRegistros->contains($customRegistro)) {
$this->customRegistros->add($customRegistro);
$customRegistro->setMetadata($this);
}
return $this;
}
public function removeCustomRegistro(CustomRegistro $customRegistro): static
{
if ($this->customRegistros->removeElement($customRegistro)) {
// set the owning side to null (unless already changed)
if ($customRegistro->getMetadata() === $this) {
$customRegistro->setMetadata(null);
}
}
return $this;
}
/**
* @return Collection<int, Entidad>
*/
public function getEntidades(): Collection
{
return $this->entidades;
}
public function addEntidade(Entidad $entidade): static
{
if (!$this->entidades->contains($entidade)) {
$this->entidades->add($entidade);
$entidade->addMetadataCustomRegistrosEnabled($this);
}
return $this;
}
public function removeEntidade(Entidad $entidade): static
{
if ($this->entidades->removeElement($entidade)) {
$entidade->removeMetadataCustomRegistrosEnabled($this);
}
return $this;
}
}