Private
Public Access
1
0

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:
2026-04-09 20:21:01 +02:00
parent 23547f4237
commit b55c223d8a
55 changed files with 1567 additions and 4398 deletions

View File

@@ -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;
}
}