<?php
namespace App\Entity;
use App\Repository\HotelRoomTypeArrangementRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[ORM\Entity(repositoryClass: HotelRoomTypeArrangementRepository::class)]
#[UniqueEntity(fields: ['hotelRoomType', 'arrangement'])]
class HotelRoomTypeArrangement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?HotelRoomType $hotelRoomType = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Arrangement $arrangement = null;
public function __construct(HotelRoomType $hotelRoomType, Arrangement $arrangement)
{
$this->hotelRoomType = $hotelRoomType;
$this->arrangement = $arrangement;
}
public function getId(): int
{
return $this->id;
}
public function getHotelRoomType(): ?HotelRoomType
{
return $this->hotelRoomType;
}
public function setHotelRoomType(?HotelRoomType $hotelRoomType): self
{
$this->hotelRoomType = $hotelRoomType;
return $this;
}
public function getArrangement(): ?Arrangement
{
return $this->arrangement;
}
public function setArrangement(?Arrangement $arrangement): self
{
$this->arrangement = $arrangement;
return $this;
}
public function __toString(): string
{
return $this->hotelRoomType.' x '.$this->arrangement->getCode();
}
}