chg: pkg: make a massive refactor to the backend and remove all unnecessary deps - and make small refactors for the frontend too #4
This commit is contained in:
0
src/Entity/.gitignore
vendored
0
src/Entity/.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
@@ -10,166 +10,97 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Repository\GamerRepository;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Class Gamer
|
||||
*
|
||||
* @package App\Entity
|
||||
* @author system7 <https://www.splendidbear.org>
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\GamerRepository")
|
||||
* @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: GamerRepository::class)]
|
||||
class Gamer
|
||||
{
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
#[Id, GeneratedValue, Column]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="user_name", type="string", length=100, nullable=false)
|
||||
*/
|
||||
private $userName;
|
||||
#[Column(length: 100)]
|
||||
private ?string $userName = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="ip", type="string", length=20, nullable=true)
|
||||
*/
|
||||
private $ip;
|
||||
#[Column(length: 20, nullable: true)]
|
||||
private ?string $ip = null;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* $ip='0.0.0.0';
|
||||
* $ip=$_SERVER['REMOTE_ADDR'];
|
||||
* $clientDetails = json_decode(file_get_contents("http://ipinfo.io/$ip/json"));
|
||||
* echo "You're logged in from: <b>" . $clientDetails->country . "</b>";
|
||||
*
|
||||
* function GetIP()
|
||||
* {
|
||||
* if ( getenv("HTTP_CLIENT_IP") ) {
|
||||
* $ip = getenv("HTTP_CLIENT_IP");
|
||||
* } elseif ( getenv("HTTP_X_FORWARDED_FOR") ) {
|
||||
* $ip = getenv("HTTP_X_FORWARDED_FOR");
|
||||
* if ( strstr($ip, ',') ) {
|
||||
* $tmp = explode(',', $ip);
|
||||
* $ip = trim($tmp[0]);
|
||||
* }
|
||||
* } else {
|
||||
* $ip = getenv("REMOTE_ADDR");
|
||||
* }
|
||||
* return $ip;
|
||||
* }
|
||||
*/
|
||||
#[Column(length: 100, nullable: true)]
|
||||
private ?string $country = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="country", type="string", length=100, nullable=true)
|
||||
*/
|
||||
private $country;
|
||||
#[Column(nullable: true)]
|
||||
private ?string $userAgent = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @see http://symfony.com/doc/current/components/http_foundation.html
|
||||
*
|
||||
* @ORM\Column(name="user_agent", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $userAgent;
|
||||
#[Column(type: Types::DATETIME_MUTABLE)]
|
||||
private ?DateTime $connTimestamp = null;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="conn_timestamp", type="datetime", nullable=false)
|
||||
*/
|
||||
private $connTimestamp;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUserName(): ?string
|
||||
{
|
||||
return $this->userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $userName
|
||||
*/
|
||||
public function setUserName(?string $userName): void
|
||||
{
|
||||
$this->userName = $userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIp(): ?string
|
||||
{
|
||||
return $this->ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $ip
|
||||
*/
|
||||
public function setIp(?string $ip): void
|
||||
{
|
||||
$this->ip = $ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry(): string
|
||||
public function getCountry(): ?string
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $country
|
||||
*/
|
||||
public function setCountry(string $country): void
|
||||
public function setCountry(?string $country): void
|
||||
{
|
||||
$this->country = $country;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUserAgent(): string
|
||||
public function getUserAgent(): ?string
|
||||
{
|
||||
return $this->userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $userAgent
|
||||
*/
|
||||
public function setUserAgent(string $userAgent): void
|
||||
public function setUserAgent(?string $userAgent): void
|
||||
{
|
||||
$this->userAgent = $userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getConnTimestamp(): \DateTime
|
||||
public function getConnTimestamp(): ?DateTime
|
||||
{
|
||||
return $this->connTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $connTimestamp
|
||||
*/
|
||||
public function setConnTimestamp(\DateTime $connTimestamp): void
|
||||
public function setConnTimestamp(?DateTime $connTimestamp): void
|
||||
{
|
||||
$this->connTimestamp = $connTimestamp;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2019 @ www.splendidbear.org
|
||||
* 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.
|
||||
@@ -10,74 +10,74 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Repository\GridRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
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\OneToMany;
|
||||
use Doctrine\ORM\Mapping\OneToOne;
|
||||
|
||||
/**
|
||||
* Class Grid
|
||||
*
|
||||
* @package App\Entity
|
||||
* @author system7 <https://www.splendidbear.org>
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\GridRepository")
|
||||
* @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: GridRepository::class)]
|
||||
class Grid
|
||||
{
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
#[Id, GeneratedValue, Column]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var PlayedGame|null
|
||||
*
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\PlayedGame", inversedBy="grid", cascade={"persist"})
|
||||
*/
|
||||
private $playedGame;
|
||||
#[OneToOne(inversedBy: 'grid', cascade: ['persist'])]
|
||||
private ?PlayedGame $playedGame = null;
|
||||
|
||||
/**
|
||||
* @var GridRow|null
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\GridRow", mappedBy="grid", cascade={"persist"})
|
||||
* @ORM\JoinColumn(name="grid_row", referencedColumnName="id", onDelete="CASCADE")
|
||||
*/
|
||||
private $gridRow;
|
||||
#[OneToMany(mappedBy: 'grid', targetEntity: GridRow::class, cascade: ['persist'])]
|
||||
#[JoinColumn(name: 'grid_row', referencedColumnName: 'id', onDelete: 'CASCADE')]
|
||||
private Collection $gridRow;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->gridRow = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PlayedGame|null
|
||||
*/
|
||||
public function getPlayedGame()
|
||||
public function getPlayedGame(): ?PlayedGame
|
||||
{
|
||||
return $this->playedGame;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PlayedGame|null $playedGame
|
||||
*/
|
||||
public function setPlayedGame( $playedGame): void
|
||||
public function setPlayedGame(?PlayedGame $playedGame): void
|
||||
{
|
||||
$this->playedGame = $playedGame;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return GridRow|null
|
||||
*/
|
||||
public function getGridRow()
|
||||
public function getGridRow(): Collection
|
||||
{
|
||||
return $this->gridRow;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param GridRow|null $gridRow
|
||||
*/
|
||||
public function setGridRow( $gridRow): void
|
||||
public function addGridRow(GridRow $gridRow): void
|
||||
{
|
||||
$this->gridRow = $gridRow;
|
||||
$this->gridRow->add($gridRow);
|
||||
$gridRow->setGrid($this);
|
||||
}
|
||||
|
||||
public function removeGridRow(GridRow $gridRow): void
|
||||
{
|
||||
$this->gridRow->removeElement($gridRow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2019 @ www.splendidbear.org
|
||||
* 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.
|
||||
@@ -10,73 +10,60 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Repository\GridRowRepository;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Class GridRow
|
||||
*
|
||||
* @package App\Entity
|
||||
* @author system7 <https://www.splendidbear.org>
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\GridRowRepository")
|
||||
* @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: GridRowRepository::class)]
|
||||
class GridRow
|
||||
{
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
#[Id, GeneratedValue, Column]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var Grid|null
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Grid", inversedBy="gridRow", cascade={"persist"})
|
||||
* @ORM\JoinColumn(name="grid", referencedColumnName="id", onDelete="CASCADE")
|
||||
*/
|
||||
private $grid;
|
||||
#[ManyToOne(cascade: ['persist'], inversedBy: 'gridRow')]
|
||||
#[JoinColumn(name: 'grid', referencedColumnName: 'id', onDelete: 'CASCADE')]
|
||||
private ?Grid $grid = null;
|
||||
|
||||
#[Column(name: 'grid_col', type: Types::JSON, nullable: false)]
|
||||
private ?array $gridCol = null;
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*
|
||||
* @ORM\Column(name="grid_col", type="json_array", nullable=false)
|
||||
*/
|
||||
private $gridCol;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Grid|null
|
||||
*/
|
||||
public function getGrid()
|
||||
public function getGrid(): ?Grid
|
||||
{
|
||||
return $this->grid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Grid|null $grid
|
||||
*/
|
||||
public function setGrid( $grid): void
|
||||
public function setGrid(?Grid $grid): void
|
||||
{
|
||||
$this->grid = $grid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
public function getGridCol()
|
||||
public function getGridCol(): ?array
|
||||
{
|
||||
return $this->gridCol;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $gridCol
|
||||
*/
|
||||
public function setGridCol($gridCol): void
|
||||
public function setGridCol(?array $gridCol): void
|
||||
{
|
||||
$this->gridCol = $gridCol;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2019 @ www.splendidbear.org
|
||||
* 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.
|
||||
@@ -10,355 +10,242 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Application\Sonata\UserBundle\Entity\User;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
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 system7 <https://www.splendidbear.org>
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\PlayedGameRepository")
|
||||
* @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
|
||||
{
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
#[Id, GeneratedValue, Column]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="game_assoc", type="string", length=50, nullable=false)
|
||||
*/
|
||||
private $gameAssoc;
|
||||
#[Column(length: 50)]
|
||||
private ?string $gameAssoc = null;
|
||||
|
||||
/**
|
||||
* @var Grid|null
|
||||
*
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Grid", mappedBy="playedGame", cascade={"persist"})
|
||||
*/
|
||||
private $grid;
|
||||
#[Column(length: 5, nullable: true)]
|
||||
private ?int $redPoints = null;
|
||||
|
||||
/**
|
||||
* @var User|null
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\UserBundle\Entity\User")
|
||||
* @ORM\JoinColumn(name="red_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
private $red;
|
||||
#[Column(length: 5, nullable: true)]
|
||||
private ?int $bluePoints = null;
|
||||
|
||||
/**
|
||||
* @var Gamer|null
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Gamer")
|
||||
* @ORM\JoinColumn(name="red_anon", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
private $redAnon;
|
||||
#[Column(nullable: true)]
|
||||
private ?bool $redExplodedBomb = null;
|
||||
|
||||
/**
|
||||
* @var User|null
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\UserBundle\Entity\User")
|
||||
* @ORM\JoinColumn(name="blue_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
private $blue;
|
||||
#[Column(nullable: true)]
|
||||
private ?bool $blueExplodedBomb = null;
|
||||
|
||||
/**
|
||||
* @var Gamer|null
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Gamer")
|
||||
* @ORM\JoinColumn(name="blue_anon", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
private $blueAnon;
|
||||
#[Column(length: 7, nullable: true)]
|
||||
private ?string $resign = null;
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*
|
||||
* @ORM\Column(name="red_points", type="integer", length=5, nullable=true)
|
||||
*/
|
||||
private $redPoints;
|
||||
#[Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?DateTime $created = null;
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*
|
||||
* @ORM\Column(name="blue_points", type="integer", length=5, nullable=true)
|
||||
*/
|
||||
private $bluePoints;
|
||||
#[Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?DateTime $updated = null;
|
||||
|
||||
/**
|
||||
* @var boolean|null
|
||||
*
|
||||
* @ORM\Column(name="red_exploded_bomb", type="boolean", nullable=true)
|
||||
*/
|
||||
private $redExplodedBomb;
|
||||
#[OneToOne(mappedBy: 'playedGame', cascade: ['persist'])]
|
||||
private ?Grid $grid = null;
|
||||
|
||||
/**
|
||||
* @var boolean|null
|
||||
*
|
||||
* @ORM\Column(name="blue_exploded_bomb", type="boolean", nullable=true)
|
||||
*/
|
||||
private $blueExplodedBomb;
|
||||
#[ManyToOne]
|
||||
#[JoinColumn(name: 'red_id', referencedColumnName: 'id', nullable: true)]
|
||||
private ?User $red = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="resign", type="string", length=7, nullable=true)
|
||||
*/
|
||||
private $resign;
|
||||
#[ManyToOne]
|
||||
#[JoinColumn(name: 'red_anon', referencedColumnName: 'id', nullable: true)]
|
||||
private ?Gamer $redAnon = null;
|
||||
|
||||
/**
|
||||
* @var \DateTime|null
|
||||
*
|
||||
* @ORM\Column(name="created", type="datetime", nullable=true)
|
||||
*/
|
||||
private $created;
|
||||
#[ManyToOne]
|
||||
#[JoinColumn(name: 'blue_id', referencedColumnName: 'id', nullable: true)]
|
||||
private ?User $blue = null;
|
||||
|
||||
/**
|
||||
* @var \DateTime|null
|
||||
*
|
||||
* @ORM\Column(name="updated", type="datetime", nullable=true)
|
||||
*/
|
||||
private $updated;
|
||||
#[ManyToOne]
|
||||
#[JoinColumn(name: 'blue_anon', referencedColumnName: 'id', nullable: true)]
|
||||
private ?Gamer $blueAnon = null;
|
||||
|
||||
#[OneToOne(mappedBy: 'playedGame')]
|
||||
private ?Step $step = null;
|
||||
|
||||
/**
|
||||
* @var Step|null
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\Step", mappedBy="playedGame")
|
||||
* @ORM\JoinColumn(name="step", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
private $step;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function setId(?int $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGameAssoc(): ?string
|
||||
{
|
||||
return $this->gameAssoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $gameAssoc
|
||||
*/
|
||||
public function setGameAssoc(?string $gameAssoc): void
|
||||
public function setGameAssoc(?string $gameAssoc): self
|
||||
{
|
||||
$this->gameAssoc = $gameAssoc;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Grid|null
|
||||
*/
|
||||
public function getGrid()
|
||||
{
|
||||
return $this->grid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Grid|null $grid
|
||||
*/
|
||||
public function setGrid( $grid): void
|
||||
{
|
||||
$this->grid = $grid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User|null
|
||||
*/
|
||||
public function getRed()
|
||||
{
|
||||
return $this->red;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User|null $red
|
||||
*/
|
||||
public function setRed( $red): void
|
||||
{
|
||||
$this->red = $red;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Gamer|null
|
||||
*/
|
||||
public function getRedAnon()
|
||||
{
|
||||
return $this->redAnon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Gamer|null $redAnon
|
||||
*/
|
||||
public function setRedAnon( $redAnon): void
|
||||
{
|
||||
$this->redAnon = $redAnon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User|null
|
||||
*/
|
||||
public function getBlue()
|
||||
{
|
||||
return $this->blue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User|null $blue
|
||||
*/
|
||||
public function setBlue( $blue): void
|
||||
{
|
||||
$this->blue = $blue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Gamer|null
|
||||
*/
|
||||
public function getBlueAnon()
|
||||
{
|
||||
return $this->blueAnon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Gamer|null $blueAnon
|
||||
*/
|
||||
public function setBlueAnon( $blueAnon): void
|
||||
{
|
||||
$this->blueAnon = $blueAnon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getRedPoints(): ?int
|
||||
{
|
||||
return $this->redPoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $redPoints
|
||||
*/
|
||||
public function setRedPoints(?int $redPoints): void
|
||||
public function setRedPoints(?int $redPoints): self
|
||||
{
|
||||
$this->redPoints = $redPoints;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getBluePoints(): ?int
|
||||
{
|
||||
return $this->bluePoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $bluePoints
|
||||
*/
|
||||
public function setBluePoints(?int $bluePoints): void
|
||||
public function setBluePoints(?int $bluePoints): self
|
||||
{
|
||||
$this->bluePoints = $bluePoints;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getRedExplodedBomb(): ?bool
|
||||
{
|
||||
return $this->redExplodedBomb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool|null $redExplodedBomb
|
||||
*/
|
||||
public function setRedExplodedBomb(?bool $redExplodedBomb): void
|
||||
public function setRedExplodedBomb(?bool $redExplodedBomb): self
|
||||
{
|
||||
$this->redExplodedBomb = $redExplodedBomb;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getBlueExplodedBomb(): ?bool
|
||||
{
|
||||
return $this->blueExplodedBomb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool|null $blueExplodedBomb
|
||||
*/
|
||||
public function setBlueExplodedBomb(?bool $blueExplodedBomb): void
|
||||
public function setBlueExplodedBomb(?bool $blueExplodedBomb): self
|
||||
{
|
||||
$this->blueExplodedBomb = $blueExplodedBomb;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getResign(): ?string
|
||||
{
|
||||
return $this->resign;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $resign
|
||||
*/
|
||||
public function setResign(?string $resign): void
|
||||
public function setResign(?string $resign): self
|
||||
{
|
||||
$this->resign = $resign;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getCreated(): ?\DateTime
|
||||
public function getCreated(): ?DateTime
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime|null $created
|
||||
*/
|
||||
public function setCreated(?\DateTime $created): void
|
||||
public function setCreated(?DateTime $created): self
|
||||
{
|
||||
$this->created = $created;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getUpdated(): ?\DateTime
|
||||
public function getUpdated(): ?DateTime
|
||||
{
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime|null $updated
|
||||
*/
|
||||
public function setUpdated(?\DateTime $updated): void
|
||||
public function setUpdated(?DateTime $updated): self
|
||||
{
|
||||
$this->updated = $updated;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Step|null
|
||||
*/
|
||||
public function getStep()
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Step|null $step
|
||||
*/
|
||||
public function setStep( $step): void
|
||||
public function setStep(?Step $step): self
|
||||
{
|
||||
$this->step = $step;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2019 @ www.splendidbear.org
|
||||
* 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.
|
||||
@@ -10,141 +10,98 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Repository\StepRepository;
|
||||
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\ManyToOne;
|
||||
|
||||
/**
|
||||
* Class Step
|
||||
*
|
||||
* @package App\Entity
|
||||
* @author system7 <https://www.splendidbear.org>
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\StepRepository")
|
||||
* @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: StepRepository::class)]
|
||||
class Step
|
||||
{
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
#[Id, GeneratedValue, Column]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*
|
||||
* @ORM\Column(name="row", length=3, type="integer", nullable=false)
|
||||
*/
|
||||
private $row;
|
||||
#[Column(length: 3)]
|
||||
private ?int $row = null;
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*
|
||||
* @ORM\Column(name="col", length=3, type="integer", nullable=false)
|
||||
*/
|
||||
private $col;
|
||||
#[Column(length: 3)]
|
||||
private ?int $col = null;
|
||||
|
||||
/**
|
||||
* @var boolean|null
|
||||
*
|
||||
* @ORM\Column(name="wbomb", type="boolean", nullable=true)
|
||||
*/
|
||||
private $wBomb;
|
||||
#[Column(nullable: true)]
|
||||
private ?bool $wBomb = null;
|
||||
|
||||
/**
|
||||
* @var PlayedGame|null
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\PlayedGame", inversedBy="step")
|
||||
*/
|
||||
private $playedGame;
|
||||
#[ManyToOne(inversedBy: 'step')]
|
||||
private ?PlayedGame $playedGame = null;
|
||||
|
||||
#[Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?DateTime $created = null;
|
||||
|
||||
/**
|
||||
* @var \DateTime|null
|
||||
*
|
||||
* @ORM\Column(name="created", type="datetime", nullable=true)
|
||||
*/
|
||||
private $created;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getRow(): ?int
|
||||
{
|
||||
return $this->row;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $row
|
||||
*/
|
||||
public function setRow(?int $row): void
|
||||
{
|
||||
$this->row = $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getCol(): ?int
|
||||
{
|
||||
return $this->col;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $col
|
||||
*/
|
||||
public function setCol(?int $col): void
|
||||
{
|
||||
$this->col = $col;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getWBomb(): ?bool
|
||||
{
|
||||
return $this->wBomb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool|null $wBomb
|
||||
*/
|
||||
public function setWBomb(?bool $wBomb): void
|
||||
{
|
||||
$this->wBomb = $wBomb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PlayedGame|null
|
||||
*/
|
||||
public function getPlayedGame(): ?PlayedGame
|
||||
{
|
||||
return $this->playedGame;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PlayedGame|null $playedGame
|
||||
*/
|
||||
public function setPlayedGame(?PlayedGame $playedGame): void
|
||||
{
|
||||
$this->playedGame = $playedGame;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getCreated(): ?\DateTime
|
||||
public function getCreated(): ?DateTime
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime|null $created
|
||||
*/
|
||||
public function setCreated(?\DateTime $created): void
|
||||
public function setCreated(?DateTime $created): void
|
||||
{
|
||||
$this->created = $created;
|
||||
}
|
||||
|
||||
95
src/Entity/User.php
Normal file
95
src/Entity/User.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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\UserRepository;
|
||||
use Doctrine\ORM\Mapping\Column;
|
||||
use Doctrine\ORM\Mapping\Entity;
|
||||
use Doctrine\ORM\Mapping\GeneratedValue;
|
||||
use Doctrine\ORM\Mapping\Id;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
*
|
||||
* @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: UserRepository::class)]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[Id, GeneratedValue, Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[Column(length: 180, unique: true)]
|
||||
private ?string $username = null;
|
||||
|
||||
#[Column]
|
||||
private array $roles = [];
|
||||
|
||||
#[Column(nullable: true)]
|
||||
private ?string $password = null;
|
||||
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getUsername(): ?string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function setUsername(string $username): self
|
||||
{
|
||||
$this->username = $username;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->username;
|
||||
}
|
||||
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
$roles[] = 'ROLE_USER';
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
public function setRoles(array $roles): self
|
||||
{
|
||||
$this->roles = $roles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(?string $password): self
|
||||
{
|
||||
$this->password = $password;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user