src/Entity/ParTipoPrecinto.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoPrecintoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoPrecintoRepository::class)]
  8. class ParTipoPrecinto {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $nombre null;
  15.     #[ORM\OneToMany(mappedBy'tipoPrecinto'targetEntityRFPrecinto::class)]
  16.     private Collection $precintos;
  17.     #[ORM\OneToMany(mappedBy'tipoPrecinto'targetEntityRFPrecintoSolicitud::class)]
  18.     private Collection $precintoSolicitud;
  19.     public function __toString(): string {
  20.         return $this->getNombre();
  21.     }
  22.     public function __construct() {
  23.         $this->precintos = new ArrayCollection();
  24.         $this->precintoSolicitud = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int {
  27.         return $this->id;
  28.     }
  29.     public function getNombre(): ?string {
  30.         return $this->nombre;
  31.     }
  32.     public function setNombre(string $nombre): static {
  33.         $this->nombre $nombre;
  34.         return $this;
  35.     }
  36.     /**
  37.      * @return Collection<int, RFPrecinto>
  38.      */
  39.     public function getPrecintos(): Collection {
  40.         return $this->precintos;
  41.     }
  42.     public function addPrecinto(RFPrecinto $precinto): static {
  43.         if (!$this->precintos->contains($precinto)) {
  44.             $this->precintos->add($precinto);
  45.             $precinto->setTipoPrecinto($this);
  46.         }
  47.         return $this;
  48.     }
  49.     public function removePrecinto(RFPrecinto $precinto): static {
  50.         if ($this->precintos->removeElement($precinto)) {
  51.             // set the owning side to null (unless already changed)
  52.             if ($precinto->getTipoPrecinto() === $this) {
  53.                 $precinto->setTipoPrecinto(null);
  54.             }
  55.         }
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, RFPrecintoSolicitud>
  60.      */
  61.     public function getPrecintoSolicitud(): Collection {
  62.         return $this->precintoSolicitud;
  63.     }
  64.     public function addPrecintoSolicitud(RFPrecintoSolicitud $precintoSolicitud): static {
  65.         if (!$this->precintoSolicitud->contains($precintoSolicitud)) {
  66.             $this->precintoSolicitud->add($precintoSolicitud);
  67.             $precintoSolicitud->setTipoPrecinto($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removePrecintoSolicitud(RFPrecintoSolicitud $precintoSolicitud): static {
  72.         if ($this->precintoSolicitud->removeElement($precintoSolicitud)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($precintoSolicitud->getTipoPrecinto() === $this) {
  75.                 $precintoSolicitud->setTipoPrecinto(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80. }