<?phpnamespace App\Entity;use App\Repository\ParTipoPrecintoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ParTipoPrecintoRepository::class)]class ParTipoPrecinto { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $nombre = null; #[ORM\OneToMany(mappedBy: 'tipoPrecinto', targetEntity: RFPrecinto::class)] private Collection $precintos; #[ORM\OneToMany(mappedBy: 'tipoPrecinto', targetEntity: RFPrecintoSolicitud::class)] private Collection $precintoSolicitud; public function __toString(): string { return $this->getNombre(); } public function __construct() { $this->precintos = new ArrayCollection(); $this->precintoSolicitud = 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, RFPrecinto> */ public function getPrecintos(): Collection { return $this->precintos; } public function addPrecinto(RFPrecinto $precinto): static { if (!$this->precintos->contains($precinto)) { $this->precintos->add($precinto); $precinto->setTipoPrecinto($this); } return $this; } public function removePrecinto(RFPrecinto $precinto): static { if ($this->precintos->removeElement($precinto)) { // set the owning side to null (unless already changed) if ($precinto->getTipoPrecinto() === $this) { $precinto->setTipoPrecinto(null); } } return $this; } /** * @return Collection<int, RFPrecintoSolicitud> */ public function getPrecintoSolicitud(): Collection { return $this->precintoSolicitud; } public function addPrecintoSolicitud(RFPrecintoSolicitud $precintoSolicitud): static { if (!$this->precintoSolicitud->contains($precintoSolicitud)) { $this->precintoSolicitud->add($precintoSolicitud); $precintoSolicitud->setTipoPrecinto($this); } return $this; } public function removePrecintoSolicitud(RFPrecintoSolicitud $precintoSolicitud): static { if ($this->precintoSolicitud->removeElement($precintoSolicitud)) { // set the owning side to null (unless already changed) if ($precintoSolicitud->getTipoPrecinto() === $this) { $precintoSolicitud->setTipoPrecinto(null); } } return $this; }}