DB changed.

- Removed RoomCategoryDetails.
- Updated some constraints and fields.
This commit is contained in:
2024-09-09 13:44:18 +02:00
parent 53374dfdfc
commit 09f384fce0
15 changed files with 123 additions and 348 deletions
+1 -38
View File
@@ -25,7 +25,7 @@ class RoomCategory
#[ORM\Column(length: 64, nullable: true)]
private ?string $bedType = null;
#[ORM\Column]
#[ORM\Column(nullable: false)]
private ?int $maxGuestNum = null;
/**
@@ -34,16 +34,9 @@ class RoomCategory
#[ORM\OneToMany(targetEntity: RoomCategoryPhoto::class, mappedBy: 'roomCategory', orphanRemoval: true, cascade: ['persist'])]
private Collection $roomCategoryPhotos;
/**
* @var Collection<int, RoomCategoryDetails>
*/
#[ORM\OneToMany(targetEntity: RoomCategoryDetails::class, mappedBy: 'roomCategory', orphanRemoval: true, cascade: ['persist'])]
private Collection $roomCategoryDetails;
public function __construct()
{
$this->roomCategoryPhotos = new ArrayCollection();
$this->roomCategoryDetails = new ArrayCollection();
}
public function getId(): ?int
@@ -129,36 +122,6 @@ class RoomCategory
return $this;
}
/**
* @return Collection<int, RoomCategoryDetails>
*/
public function getRoomCategoryDetails(): Collection
{
return $this->roomCategoryDetails;
}
public function addRoomCategoryDetail(RoomCategoryDetails $roomCategoryDetail): static
{
if (!$this->roomCategoryDetails->contains($roomCategoryDetail)) {
$this->roomCategoryDetails->add($roomCategoryDetail);
$roomCategoryDetail->setRoomCategory($this);
}
return $this;
}
public function removeRoomCategoryDetail(RoomCategoryDetails $roomCategoryDetail): static
{
if ($this->roomCategoryDetails->removeElement($roomCategoryDetail)) {
// set the owning side to null (unless already changed)
if ($roomCategoryDetail->getRoomCategory() === $this) {
$roomCategoryDetail->setRoomCategory(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;