<?php
namespace App\Entity;
use App\Repository\WorkroomArenaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: WorkroomArenaRepository::class)]
class WorkroomArena
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\OneToOne(targetEntity: Workroom::class, inversedBy: 'workroomArena', cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private $workroom;
#[ORM\Column(type: 'string', length: 255, unique: true)]
private $uuid;
#[ORM\Column(type: 'datetime_immutable')]
private $createdAt;
#[ORM\Column(type: 'datetime_immutable')]
private $updatedAt;
#[ORM\OneToMany(targetEntity: WorkroomSectionArena::class, mappedBy: 'workroomArena', orphanRemoval: true, cascade: ['remove'])]
private $workroomSectionArenas;
#[ORM\OneToMany(targetEntity: UserWorkroomArena::class, mappedBy: 'workroomArena', orphanRemoval: true, cascade: ['remove'])]
private $userWorkroomArenas;
#[ORM\OneToOne(targetEntity: ChatArena::class, mappedBy: 'workroomArena', cascade: ['persist', 'remove'])]
private $chatArena;
#[ORM\Column(name: 'state', type: 'smallint', options: ['default' => 1])]
private $state;
public function __construct()
{
$this->workroomSectionArenas = new ArrayCollection();
$this->userWorkroomArenas = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getWorkroom(): ?Workroom
{
return $this->workroom;
}
public function setWorkroom(Workroom $workroom): self
{
$this->workroom = $workroom;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return Collection|WorkroomSectionArena[]
*/
public function getWorkroomSectionArenas(): Collection
{
return $this->workroomSectionArenas;
}
public function addWorkroomSectionArena(WorkroomSectionArena $workroomSectionArena): self
{
if (!$this->workroomSectionArenas->contains($workroomSectionArena)) {
$this->workroomSectionArenas[] = $workroomSectionArena;
$workroomSectionArena->setWorkroomArena($this);
}
return $this;
}
public function removeWorkroomSectionArena(WorkroomSectionArena $workroomSectionArena): self
{
if ($this->workroomSectionArenas->removeElement($workroomSectionArena)) {
// set the owning side to null (unless already changed)
if ($workroomSectionArena->getWorkroomArena() === $this) {
$workroomSectionArena->setWorkroomArena(null);
}
}
return $this;
}
/**
* @return Collection|UserWorkroomArena[]
*/
public function getUserWorkroomArenas(): Collection
{
return $this->userWorkroomArenas;
}
public function addUserWorkroomArena(UserWorkroomArena $userWorkroomArena): self
{
if (!$this->userWorkroomArenas->contains($userWorkroomArena)) {
$this->userWorkroomArenas[] = $userWorkroomArena;
$userWorkroomArena->setWorkroomArena($this);
}
return $this;
}
public function removeUserWorkroomArena(UserWorkroomArena $userWorkroomArena): self
{
if ($this->userWorkroomArenas->removeElement($userWorkroomArena)) {
// set the owning side to null (unless already changed)
if ($userWorkroomArena->getWorkroomArena() === $this) {
$userWorkroomArena->setWorkroomArena(null);
}
}
return $this;
}
public function getChatArena(): ?ChatArena
{
return $this->chatArena;
}
public function setChatArena(ChatArena $chatArena): self
{
// set the owning side of the relation if necessary
if ($chatArena->getWorkroomArena() !== $this) {
$chatArena->setWorkroomArena($this);
}
$this->chatArena = $chatArena;
return $this;
}
public function getState(): ?int
{
return $this->state;
}
public function setState(int $state): self
{
$this->state = $state;
return $this;
}
}