<?php
namespace App\Domain\Entity;
use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
class MetadataExpedienteCabecera extends Metadata
{
private ?MetadataExpediente $metadataExpediente = null;
private Collection $cabeceras;
public function __construct()
{
parent::__construct();
$this->cabeceras = new ArrayCollection();
}
public function getMetadataExpediente(): ?MetadataExpediente
{
return $this->metadataExpediente;
}
public function setMetadataExpediente(?MetadataExpediente $metadataExpediente): static
{
// unset the owning side of the relation if necessary
if ($metadataExpediente === null && $this->metadataExpediente !== null) {
$this->metadataExpediente->setMetadataCabecera(null);
}
// set the owning side of the relation if necessary
if ($metadataExpediente !== null && $metadataExpediente->getMetadataCabecera() !== $this) {
$metadataExpediente->setMetadataCabecera($this);
}
$this->metadataExpediente = $metadataExpediente;
return $this;
}
/**
* @return Collection<int, ExpedienteCabecera>
*/
public function getCabeceras(): Collection
{
return $this->cabeceras;
}
public function addCabecera(ExpedienteCabecera $cabecera): static
{
if (!$this->cabeceras->contains($cabecera)) {
$this->cabeceras->add($cabecera);
$cabecera->setMetadata($this);
}
return $this;
}
public function removeCabecera(ExpedienteCabecera $cabecera): static
{
if ($this->cabeceras->removeElement($cabecera)) {
// set the owning side to null (unless already changed)
if ($cabecera->getMetadata() === $this) {
$cabecera->setMetadata(null);
}
}
return $this;
}
}