src/Flexy/BookingBundle/Entity/Reservation.php line 12

  1. <?php
  2. namespace App\Flexy\BookingBundle\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Flexy\ShopBundle\Entity\Customer\Customer;
  5. use App\Repository\Flexy\BookingBundle\Entity\ReservationRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ApiResource]
  8. #[ORM\Entity(repositoryClassReservationRepository::class)]
  9. class Reservation
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  16.     private ?\DateTimeImmutable $createdAt null;
  17.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  18.     private ?\DateTimeImmutable $startAt null;
  19.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  20.     private ?\DateTimeImmutable $endAt null;
  21.     #[ORM\ManyToOne(targetEntityOffer::class, inversedBy'reservations')]
  22.     private ?\App\Flexy\BookingBundle\Entity\Offer $offer null;
  23.     #[ORM\ManyToOne(targetEntityCustomer::class)]
  24.     private ?\App\Flexy\ShopBundle\Entity\Customer\Customer $customer null;
  25.     public function __construct()
  26.     {
  27.         $this->createdAt = new \DateTimeImmutable();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getCreatedAt(): ?\DateTimeImmutable
  34.     {
  35.         return $this->createdAt;
  36.     }
  37.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  38.     {
  39.         $this->createdAt $createdAt;
  40.         return $this;
  41.     }
  42.     public function getStartAt(): ?\DateTimeImmutable
  43.     {
  44.         return $this->startAt;
  45.     }
  46.     public function setStartAt(?\DateTimeImmutable $startAt): self
  47.     {
  48.         $this->startAt $startAt;
  49.         return $this;
  50.     }
  51.     public function getEndAt(): ?\DateTimeImmutable
  52.     {
  53.         return $this->endAt;
  54.     }
  55.     public function setEndAt(?\DateTimeImmutable $endAt): self
  56.     {
  57.         $this->endAt $endAt;
  58.         return $this;
  59.     }
  60.     public function getOffer(): ?Offer
  61.     {
  62.         return $this->offer;
  63.     }
  64.     public function setOffer(?Offer $offer): self
  65.     {
  66.         $this->offer $offer;
  67.         return $this;
  68.     }
  69.     public function getCustomer(): ?Customer
  70.     {
  71.         return $this->customer;
  72.     }
  73.     public function setCustomer(?Customer $customer): self
  74.     {
  75.         $this->customer $customer;
  76.         return $this;
  77.     }
  78. }