src/Entity/ParMotivoCambio.php line 11

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