src/Entity/ParDescripcionDiligencia.php line 11

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