src/Entity/Booking.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTimeInterface;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\BookingRepository;
  6. #[ORM\Entity(repositoryClassBookingRepository::class)]
  7. #[ORM\InheritanceType('JOINED')]
  8. #[ORM\DiscriminatorColumn(name"type"type"string")]
  9. #[ORM\DiscriminatorMap(['visitReport' => BookingVisitReport::class, 'event' => BookingEvent::class])]
  10. class Booking
  11. {
  12.     use IdentifiableTrait;
  13.     #[ORM\Column(type'datetime')]
  14.     private ?DateTimeInterface $beginAt;
  15.     #[ORM\Column(type'datetime'nullabletrue)]
  16.     private ?DateTimeInterface $endAt null;
  17.     #[ORM\Column(type'string'length255)]
  18.     private string $title;
  19.     #[ORM\ManyToOne(inversedBy'bookings')]
  20.     private ?User $owner null;
  21.     #[ORM\Column(type'datetime_immutable')]
  22.     private DateTimeInterface $updatedAt;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?bool $isCancelled null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $cancellationReason null;
  27.     public function __construct()
  28.     {
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getBeginAt(): ?DateTimeInterface
  35.     {
  36.         return $this->beginAt;
  37.     }
  38.     public function setBeginAt(DateTimeInterface $beginAt): self
  39.     {
  40.         $this->beginAt $beginAt;
  41.         return $this;
  42.     }
  43.     public function getEndAt(): ?DateTimeInterface
  44.     {
  45.         return $this->endAt;
  46.     }
  47.     public function setEndAt(?DateTimeInterface $endAt null): self
  48.     {
  49.         $this->endAt $endAt;
  50.         return $this;
  51.     }
  52.     public function getTitle(): ?string
  53.     {
  54.         return $this->title;
  55.     }
  56.     public function setTitle(string $title): self
  57.     {
  58.         $this->title $title;
  59.         return $this;
  60.     }
  61.     public function getOwner(): ?User
  62.     {
  63.         return $this->owner;
  64.     }
  65.     public function setOwner(?User $owner): static
  66.     {
  67.         $this->owner $owner;
  68.         return $this;
  69.     }
  70.     public function getUpdatedAt(): DateTimeInterface
  71.     {
  72.         return $this->updatedAt;
  73.     }
  74.     public function setUpdatedAt(DateTimeInterface $updatedAt): void
  75.     {
  76.         $this->updatedAt $updatedAt;
  77.     }
  78.     public function isIsCancelled(): ?bool
  79.     {
  80.         return $this->isCancelled;
  81.     }
  82.     public function setIsCancelled(?bool $isCancelled): static
  83.     {
  84.         $this->isCancelled $isCancelled;
  85.         return $this;
  86.     }
  87.     public function getCancellationReason(): ?string
  88.     {
  89.         return $this->cancellationReason;
  90.     }
  91.     public function setCancellationReason(?string $cancellationReason): static
  92.     {
  93.         $this->cancellationReason $cancellationReason;
  94.         return $this;
  95.     }
  96. }