src/Entity/ParTipoDisposicion.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoDisposicionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoDisposicionRepository::class)]
  8. class ParTipoDisposicion
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length100)]
  15.     private ?string $nombre null;
  16.     #[ORM\OneToMany(mappedBy'tipoDisposicion'targetEntityRFDisposicion::class)]
  17.     private Collection $disposicion;
  18.     #[ORM\OneToMany(mappedBy'tipoDisposicion'targetEntityRFDisposicionDocumento::class)]
  19.     private Collection $disposicionDocumentos;
  20.     public function __construct()
  21.     {
  22.         $this->dispocicion = new ArrayCollection();
  23.         $this->disposicion = new ArrayCollection();
  24.         $this->disposicionDocumentos = new ArrayCollection();
  25.     }
  26.     
  27.     public function __toString() {
  28.         return $this->getNombre();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getNombre(): ?string
  35.     {
  36.         return $this->nombre;
  37.     }
  38.     public function setNombre(string $nombre): static
  39.     {
  40.         $this->nombre $nombre;
  41.         return $this;
  42.     }
  43.   
  44.     /**
  45.      * @return Collection<int, RFDisposicion>
  46.      */
  47.     public function getDisposicion(): Collection
  48.     {
  49.         return $this->disposicion;
  50.     }
  51.     public function addDisposicion(RFDisposicion $disposicion): static
  52.     {
  53.         if (!$this->disposicion->contains($disposicion)) {
  54.             $this->disposicion->add($disposicion);
  55.             $disposicion->setTipoDisposicion($this);
  56.         }
  57.         return $this;
  58.     }
  59.     public function removeDisposicion(RFDisposicion $disposicion): static
  60.     {
  61.         if ($this->disposicion->removeElement($disposicion)) {
  62.             // set the owning side to null (unless already changed)
  63.             if ($disposicion->getTipoDisposicion() === $this) {
  64.                 $disposicion->setTipoDisposicion(null);
  65.             }
  66.         }
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection<int, RFDisposicionDocumento>
  71.      */
  72.     public function getDisposicionDocumentos(): Collection
  73.     {
  74.         return $this->disposicionDocumentos;
  75.     }
  76.     public function addDisposicionDocumento(RFDisposicionDocumento $disposicionDocumento): static
  77.     {
  78.         if (!$this->disposicionDocumentos->contains($disposicionDocumento)) {
  79.             $this->disposicionDocumentos->add($disposicionDocumento);
  80.             $disposicionDocumento->setTipoDisposicion($this);
  81.         }
  82.         return $this;
  83.     }
  84.     public function removeDisposicionDocumento(RFDisposicionDocumento $disposicionDocumento): static
  85.     {
  86.         if ($this->disposicionDocumentos->removeElement($disposicionDocumento)) {
  87.             // set the owning side to null (unless already changed)
  88.             if ($disposicionDocumento->getTipoDisposicion() === $this) {
  89.                 $disposicionDocumento->setTipoDisposicion(null);
  90.             }
  91.         }
  92.         return $this;
  93.     }
  94. }