<?phpnamespace App\Entity;use App\Repository\RoomRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: RoomRepository::class)]class Room{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: "integer")] protected int $id; #[ORM\Column(type: "integer", length: 6)] private ?int $roomId; #[ORM\Column(type: "string", length: 100, nullable: true)] private ?string $owner; #[ORM\Column] private ?bool $status = false; #[ORM\Column(type: "string", length: 100, nullable: true)] private ?string $gameMode = 'classic'; #[ORM\Column(type: "simple_array", nullable: true)] private ?array $mapName; #[ORM\OneToMany(mappedBy: 'room', targetEntity: User::class)] private Collection $hunters; public function __construct() { $this->hunters = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getRoomId(): ?int { return $this->roomId; } public function setRoomId(int $roomId): self { $this->roomId = $roomId; return $this; } public function getOwner(): ?string { return $this->owner; } public function setOwner(?string $owner): self { $this->owner = $owner; return $this; } public function getStatus(): ?bool { return $this->status; } public function setStatus(bool $status): self { $this->status = $status; return $this; } public function toggleStatus(): self { $this->lock = !$this->lock; return $this; } public function getGameMode(): ?string { return $this->gameMode; } public function setGameMode(?string $gameMode): self { $this->gameMode = $gameMode; return $this; } public function getMapName(): ?array { return $this->mapName; } public function setMapName(?array $mapName): self { $this->mapName = $mapName; return $this; } /** * @return Collection<int, User> */ public function getHunters(): Collection { return $this->hunters; } public function addHunter(User $hunter): self { if (!$this->hunters->contains($hunter)) { $this->hunters->add($hunter); $hunter->setRoom($this); } return $this; } public function removeHunter(User $hunter): self { if ($this->hunters->removeElement($hunter)) { // set the owning side to null (unless already changed) if ($hunter->getRoom() === $this) { $hunter->setRoom(null); } } return $this; }}