src/Entity/ParEntidadEmisora.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParEntidadEmisoraRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParEntidadEmisoraRepository::class)]
  8. class ParEntidadEmisora
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nombre null;
  16.     #[ORM\OneToMany(mappedBy'entidadEmisora'targetEntityJurNorma::class)]
  17.     private Collection $norma;
  18.     
  19.     public function __toString() {
  20.         return $this->getNombre();
  21.     }
  22.     public function __construct()
  23.     {
  24.         $this->norma = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getNombre(): ?string
  31.     {
  32.         return $this->nombre;
  33.     }
  34.     public function setNombre(string $nombre): static
  35.     {
  36.         $this->nombre $nombre;
  37.         return $this;
  38.     }
  39.     /**
  40.      * @return Collection<int, JurNorma>
  41.      */
  42.     public function getNorma(): Collection
  43.     {
  44.         return $this->norma;
  45.     }
  46.     public function addNorma(JurNorma $norma): static
  47.     {
  48.         if (!$this->norma->contains($norma)) {
  49.             $this->norma->add($norma);
  50.             $norma->setEntidadEmisora($this);
  51.         }
  52.         return $this;
  53.     }
  54.     public function removeNorma(JurNorma $norma): static
  55.     {
  56.         if ($this->norma->removeElement($norma)) {
  57.             // set the owning side to null (unless already changed)
  58.             if ($norma->getEntidadEmisora() === $this) {
  59.                 $norma->setEntidadEmisora(null);
  60.             }
  61.         }
  62.         return $this;
  63.     }
  64. }