*/ #[ORM\OneToMany(targetEntity: RoomCategoryPhoto::class, mappedBy: 'roomCategory', orphanRemoval: true, cascade: ['persist'])] private Collection $roomCategoryPhotos; /** * @var Collection */ #[ORM\OneToMany(targetEntity: RoomCategoryBedType::class, mappedBy: 'roomCategory', orphanRemoval: true, cascade: ['persist'])] private Collection $roomCategoryBedTypes; public function __construct() { $this->roomCategoryPhotos = new ArrayCollection(); $this->roomCategoryBedTypes = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } public function getMaxGuestNum(): ?int { return $this->maxGuestNum; } public function setMaxGuestNum(int $maxGuestNum): static { $this->maxGuestNum = $maxGuestNum; return $this; } public function getOrderHomePage(): ?int { return $this->orderHomePage; } public function setOrderHomePage(?int $orderHomePage): static { $this->orderHomePage = $orderHomePage; return $this; } /** * @return Collection */ public function getRoomCategoryPhotos(): Collection { return $this->roomCategoryPhotos; } public function addRoomCategoryPhoto(RoomCategoryPhoto $roomCategoryPhoto): static { if (!$this->roomCategoryPhotos->contains($roomCategoryPhoto)) { $this->roomCategoryPhotos->add($roomCategoryPhoto); $roomCategoryPhoto->setRoomCategory($this); } return $this; } public function removeRoomCategoryPhoto(RoomCategoryPhoto $roomCategoryPhoto): static { if ($this->roomCategoryPhotos->removeElement($roomCategoryPhoto)) { // set the owning side to null (unless already changed) if ($roomCategoryPhoto->getRoomCategory() === $this) { $roomCategoryPhoto->setRoomCategory(null); } } return $this; } public function __toString() { return $this->name; } /** * @return Collection */ public function getRoomCategoryBedTypes(): Collection { return $this->roomCategoryBedTypes; } public function addRoomCategoryBedType(RoomCategoryBedType $roomCategoryBedType): static { if (!$this->roomCategoryBedTypes->contains($roomCategoryBedType)) { $this->roomCategoryBedTypes->add($roomCategoryBedType); $roomCategoryBedType->setRoomCategory($this); } return $this; } public function removeRoomCategoryBedType(RoomCategoryBedType $roomCategoryBedType): static { if ($this->roomCategoryBedTypes->removeElement($roomCategoryBedType)) { // set the owning side to null (unless already changed) if ($roomCategoryBedType->getRoomCategory() === $this) { $roomCategoryBedType->setRoomCategory(null); } } return $this; } }