<?php
namespace App\Entity;
use App\Repository\BookingConstraintPeriodRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BookingConstraintPeriodRepository::class)]
class BookingConstraintPeriod
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer")]
private $id;
#[ORM\Column(type: "datetime")]
private $startDate;
#[ORM\Column(type: "datetime")]
private $endDate;
#[ORM\ManyToOne(targetEntity: BookingConstraint::class, inversedBy: "unavailablePeriods")]
#[ORM\JoinColumn(nullable: false)]
private $bookingConstraint;
public function __toString()
{
return $this->startDate->format('d/m/Y')." - ".$this->endDate->format('d/m/Y');
}
public function getId(): ?int
{
return $this->id;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
public function getBookingConstraint(): ?BookingConstraint
{
return $this->bookingConstraint;
}
public function setBookingConstraint(?BookingConstraint $bookingConstraint): self
{
$this->bookingConstraint = $bookingConstraint;
return $this;
}
}