RoomAvailability - Initial implementation

This commit is contained in:
2024-04-28 03:19:19 +02:00
parent 7a56158563
commit 8e7bad7771
9 changed files with 258 additions and 9 deletions
+60
View File
@@ -0,0 +1,60 @@
<?php
namespace App\Entity;
use App\Repository\RoomAvailabilityRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RoomAvailabilityRepository::class)]
class RoomAvailability
{
#[ORM\Id]
#[ORM\Column]
private ?string $day = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: RoomCategory::class)]
#[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")]
private ?RoomCategory $roomCategory = null;
#[ORM\Column]
private ?int $numAvailable = null;
public function getDay(): ?\DateTimeInterface
{
return new \DateTime($this->day);
}
public function setDay(\DateTimeInterface $day): static
{
$this->day = $day->format("Ymd");
return $this;
}
public function getRoomCategory(): ?RoomCategory
{
return $this->roomCategory;
}
public function setRoomCategory(?RoomCategory $roomCategory): static
{
$this->roomCategory = $roomCategory;
return $this;
}
public function getNumAvailable(): ?int
{
return $this->numAvailable;
}
public function setNumAvailable(int $numAvailable): static
{
$this->numAvailable = $numAvailable;
return $this;
}
}