Files
SomniaRooms/src/Entity/BookingRoom.php
T

112 lines
2.2 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\BookingRoomRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Ignore;
#[ORM\Entity(repositoryClass: BookingRoomRepository::class)]
class BookingRoom
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Ignore]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'bookingRooms')]
#[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")]
#[Ignore]
private ?Booking $booking = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
#[Ignore]
private ?RoomCategory $roomCategory = null;
#[ORM\Column]
private ?int $guestNumber = null;
#[ORM\Column]
private ?int $roomPrice = null;
#[ORM\Column]
private ?int $amount = null;
public function getId(): ?int
{
return $this->id;
}
public function getBooking(): ?Booking
{
return $this->booking;
}
public function setBooking(?Booking $booking): static
{
$this->booking = $booking;
return $this;
}
public function getRoomCategory(): ?RoomCategory
{
return $this->roomCategory;
}
public function setRoomCategory(?RoomCategory $roomCategory): static
{
$this->roomCategory = $roomCategory;
return $this;
}
public function getRoomCategoryId(): int
{
return $this->getRoomCategory()->getId();
}
public function getGuestNumber(): ?int
{
return $this->guestNumber;
}
public function setGuestNumber(int $guestNumber): static
{
$this->guestNumber = $guestNumber;
return $this;
}
public function getRoomPrice(): ?int
{
return $this->roomPrice;
}
public function setRoomPrice(int $roomPrice): static
{
$this->roomPrice = $roomPrice;
return $this;
}
public function getAmount(): ?int
{
return $this->amount;
}
public function setAmount(int $amount): static
{
$this->amount = $amount;
return $this;
}
function __toString(): string
{
return $this->getAmount() . " " . $this->getRoomCategory()->getName() . " - " . $this->getGuestNumber() . " Guests";
}
}