src/Entity/BookingConstraintPeriod.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BookingConstraintPeriodRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassBookingConstraintPeriodRepository::class)]
  6. class BookingConstraintPeriod
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type"integer")]
  11.     private $id;
  12.     #[ORM\Column(type"datetime")]
  13.     private $startDate;
  14.     #[ORM\Column(type"datetime")]
  15.     private $endDate;
  16.     #[ORM\ManyToOne(targetEntityBookingConstraint::class, inversedBy"unavailablePeriods")]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private $bookingConstraint;
  19.     public function __toString()
  20.     {
  21.         return $this->startDate->format('d/m/Y')." - ".$this->endDate->format('d/m/Y');
  22.     }
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getStartDate(): ?\DateTimeInterface
  28.     {
  29.         return $this->startDate;
  30.     }
  31.     public function setStartDate(\DateTimeInterface $startDate): self
  32.     {
  33.         $this->startDate $startDate;
  34.         return $this;
  35.     }
  36.     public function getEndDate(): ?\DateTimeInterface
  37.     {
  38.         return $this->endDate;
  39.     }
  40.     public function setEndDate(\DateTimeInterface $endDate): self
  41.     {
  42.         $this->endDate $endDate;
  43.         return $this;
  44.     }
  45.     public function getBookingConstraint(): ?BookingConstraint
  46.     {
  47.         return $this->bookingConstraint;
  48.     }
  49.     public function setBookingConstraint(?BookingConstraint $bookingConstraint): self
  50.     {
  51.         $this->bookingConstraint $bookingConstraint;
  52.         return $this;
  53.     }
  54. }