Private
Public Access
1
0
Files
MineSeeker/src/Entity/PlayedGame.php

252 lines
5.4 KiB
PHP
Raw Normal View History

<?php declare(strict_types=1);
/*
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2026 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use App\Repository\PlayedGameRepository;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToOne;
/**
* Class PlayedGame
*
* @package App\Entity
* @author Lang <https://www.splendidbear.org>
* @category Class
* @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License
* @link www.splendidbear.org
* @since 2026. 04. 09.
*/
#[Entity(repositoryClass: PlayedGameRepository::class)]
class PlayedGame
{
#[Id, GeneratedValue, Column]
private ?int $id = null;
#[Column(length: 50)]
private ?string $gameAssoc = null;
#[Column(length: 5, nullable: true)]
private ?int $redPoints = null;
#[Column(length: 5, nullable: true)]
private ?int $bluePoints = null;
#[Column(nullable: true)]
private ?bool $redExplodedBomb = null;
#[Column(nullable: true)]
private ?bool $blueExplodedBomb = null;
#[Column(length: 7, nullable: true)]
private ?string $resign = null;
#[Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?DateTime $created = null;
#[Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?DateTime $updated = null;
#[OneToOne(mappedBy: 'playedGame', cascade: ['persist'])]
private ?Grid $grid = null;
#[ManyToOne]
#[JoinColumn(name: 'red_id', referencedColumnName: 'id', nullable: true)]
private ?User $red = null;
#[ManyToOne]
#[JoinColumn(name: 'red_anon', referencedColumnName: 'id', nullable: true)]
private ?Gamer $redAnon = null;
#[ManyToOne]
#[JoinColumn(name: 'blue_id', referencedColumnName: 'id', nullable: true)]
private ?User $blue = null;
#[ManyToOne]
#[JoinColumn(name: 'blue_anon', referencedColumnName: 'id', nullable: true)]
private ?Gamer $blueAnon = null;
#[OneToOne(mappedBy: 'playedGame')]
private ?Step $step = null;
public function getId(): ?int
{
return $this->id;
}
public function setId(?int $id): self
{
$this->id = $id;
return $this;
}
public function getGameAssoc(): ?string
{
return $this->gameAssoc;
}
public function setGameAssoc(?string $gameAssoc): self
{
$this->gameAssoc = $gameAssoc;
return $this;
}
public function getRedPoints(): ?int
{
return $this->redPoints;
}
public function setRedPoints(?int $redPoints): self
{
$this->redPoints = $redPoints;
return $this;
}
public function getBluePoints(): ?int
{
return $this->bluePoints;
}
public function setBluePoints(?int $bluePoints): self
{
$this->bluePoints = $bluePoints;
return $this;
}
public function getRedExplodedBomb(): ?bool
{
return $this->redExplodedBomb;
}
public function setRedExplodedBomb(?bool $redExplodedBomb): self
{
$this->redExplodedBomb = $redExplodedBomb;
return $this;
}
public function getBlueExplodedBomb(): ?bool
{
return $this->blueExplodedBomb;
}
public function setBlueExplodedBomb(?bool $blueExplodedBomb): self
{
$this->blueExplodedBomb = $blueExplodedBomb;
return $this;
}
public function getResign(): ?string
{
return $this->resign;
}
public function setResign(?string $resign): self
{
$this->resign = $resign;
return $this;
}
public function getCreated(): ?DateTime
{
return $this->created;
}
public function setCreated(?DateTime $created): self
{
$this->created = $created;
return $this;
}
public function getUpdated(): ?DateTime
{
return $this->updated;
}
public function setUpdated(?DateTime $updated): self
{
$this->updated = $updated;
return $this;
}
public function getGrid(): ?Grid
{
return $this->grid;
}
public function setGrid(?Grid $grid): self
{
$this->grid = $grid;
return $this;
}
public function getRed(): ?User
{
return $this->red;
}
public function setRed(?User $red): self
{
$this->red = $red;
return $this;
}
public function getRedAnon(): ?Gamer
{
return $this->redAnon;
}
public function setRedAnon(?Gamer $redAnon): self
{
$this->redAnon = $redAnon;
return $this;
}
public function getBlue(): ?User
{
return $this->blue;
}
public function setBlue(?User $blue): self
{
$this->blue = $blue;
return $this;
}
public function getBlueAnon(): ?Gamer
{
return $this->blueAnon;
}
public function setBlueAnon(?Gamer $blueAnon): self
{
$this->blueAnon = $blueAnon;
return $this;
}
public function getStep(): ?Step
{
return $this->step;
}
public function setStep(?Step $step): self
{
$this->step = $step;
return $this;
}
}