<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class EstadoReserva extends \App\Entity\BaseEntity
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $nombre;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Reserva::class, mappedBy="estadoReserva")
*/
private $reservas;
public function __construct()
{
$this->reservas = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(?string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
/**
* @return Collection<int, Reserva>
*/
public function getReservas(): Collection
{
return $this->reservas;
}
public function addReserva(Reserva $reserva): static
{
if (!$this->reservas->contains($reserva)) {
$this->reservas->add($reserva);
$reserva->setEstadoReserva($this);
}
return $this;
}
public function removeReserva(Reserva $reserva): static
{
if ($this->reservas->removeElement($reserva)) {
// set the owning side to null (unless already changed)
if ($reserva->getEstadoReserva() === $this) {
$reserva->setEstadoReserva(null);
}
}
return $this;
}
public function __toString(): string
{
return $this->nombre;
}
}