Messages handling voor spel 1
This commit is contained in:
89
src/Game/Entity/Session.php
Normal file
89
src/Game/Entity/Session.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\Game\Entity;
|
||||
|
||||
use App\Game\Enum\SessionStatus;
|
||||
use App\Game\Repository\SessionRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SessionRepository::class)]
|
||||
#[ORM\Table(name: 'session')]
|
||||
class Session
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Game::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Game $game = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 20, enumType: SessionStatus::class)]
|
||||
private ?SessionStatus $status = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?int $timer = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $created = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->created = new \DateTime();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getGame(): ?Game
|
||||
{
|
||||
return $this->game;
|
||||
}
|
||||
|
||||
public function setGame(?Game $game): static
|
||||
{
|
||||
$this->game = $game;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatus(): ?SessionStatus
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setStatus(SessionStatus $status): static
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTimer(): ?int
|
||||
{
|
||||
return $this->timer;
|
||||
}
|
||||
|
||||
public function setTimer(int $timer): static
|
||||
{
|
||||
$this->timer = $timer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreated(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
public function setCreated(\DateTimeInterface $created): static
|
||||
{
|
||||
$this->created = $created;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user