Files
SomniaRooms/src/Entity/RoomPrice.php
T
2026-01-13 10:48:04 +01:00

82 lines
1.6 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\RoomPriceRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RoomPriceRepository::class)]
class RoomPrice
{
#[ORM\Id]
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?RoomCategory $roomCategory = null;
#[ORM\Id]
#[ORM\Column(length: 10, nullable: false)]
private ?string $date = null;
#[ORM\Id]
#[ORM\Column(type: Types::SMALLINT, nullable: false)]
private ?int $guestNumber = null;
#[ORM\Column(nullable: false)]
private ?int $price = null;
public function getRoomCategory(): ?RoomCategory
{
return $this->roomCategory;
}
public function setRoomCategory(?RoomCategory $roomCategory): static
{
$this->roomCategory = $roomCategory;
return $this;
}
public function getDate(): ?\DateTimeImmutable
{
return new \DateTimeImmutable($this->date);
}
public function getDateString(): ?string
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): static
{
$this->date = $date->format('Y-m-d');
return $this;
}
public function getGuestNumber(): ?int
{
return $this->guestNumber;
}
public function setGuestNumber(int $guestNumber): static
{
$this->guestNumber = $guestNumber;
return $this;
}
public function getPrice(): ?int
{
return $this->price;
}
public function setPrice(int $price): static
{
$this->price = $price;
return $this;
}
}