* @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 { #[Id, GeneratedValue, Column] private ?int $id = null; #[OneToOne(inversedBy: 'grid', cascade: ['persist'])] private ?PlayedGame $playedGame = null; #[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; } public function getPlayedGame(): ?PlayedGame { return $this->playedGame; } public function setPlayedGame(?PlayedGame $playedGame): void { $this->playedGame = $playedGame; } public function getGridRow(): Collection { return $this->gridRow; } public function addGridRow(GridRow $gridRow): void { $this->gridRow->add($gridRow); $gridRow->setGrid($this); } public function removeGridRow(GridRow $gridRow): void { $this->gridRow->removeElement($gridRow); } }