<?php
namespace App\Entity;
use App\Repository\ParEntidadEmisoraRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParEntidadEmisoraRepository::class)]
class ParEntidadEmisora
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nombre = null;
#[ORM\OneToMany(mappedBy: 'entidadEmisora', targetEntity: JurNorma::class)]
private Collection $norma;
public function __toString() {
return $this->getNombre();
}
public function __construct()
{
$this->norma = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
/**
* @return Collection<int, JurNorma>
*/
public function getNorma(): Collection
{
return $this->norma;
}
public function addNorma(JurNorma $norma): static
{
if (!$this->norma->contains($norma)) {
$this->norma->add($norma);
$norma->setEntidadEmisora($this);
}
return $this;
}
public function removeNorma(JurNorma $norma): static
{
if ($this->norma->removeElement($norma)) {
// set the owning side to null (unless already changed)
if ($norma->getEntidadEmisora() === $this) {
$norma->setEntidadEmisora(null);
}
}
return $this;
}
}