src/Entity/ParTipoDiligencia.php line 11

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