<?php
namespace App\Entity;
use App\Repository\ParMotivoCambioRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParMotivoCambioRepository::class)]
class ParMotivoCambio
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nombre = null;
#[ORM\OneToMany(mappedBy: 'motivo', targetEntity: GHCambioContrato::class)]
private Collection $cambioContrato;
#[ORM\ManyToOne(inversedBy: 'motivoCambio')]
private ?ParEstado $estado = null;
public function __construct()
{
$this->cambioContrato = new ArrayCollection();
}
public function __toString()
{
return $this->nombre;
}
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, GHCambioContrato>
*/
public function getCambioContrato(): Collection
{
return $this->cambioContrato;
}
public function addCambioContrato(GHCambioContrato $cambioContrato): static
{
if (!$this->cambioContrato->contains($cambioContrato)) {
$this->cambioContrato->add($cambioContrato);
$cambioContrato->setMotivo($this);
}
return $this;
}
public function removeCambioContrato(GHCambioContrato $cambioContrato): static
{
if ($this->cambioContrato->removeElement($cambioContrato)) {
// set the owning side to null (unless already changed)
if ($cambioContrato->getMotivo() === $this) {
$cambioContrato->setMotivo(null);
}
}
return $this;
}
public function getEstado(): ?ParEstado
{
return $this->estado;
}
public function setEstado(?ParEstado $estado): static
{
$this->estado = $estado;
return $this;
}
}