<?php
namespace App\Core\Entity;
use App\Core\Repository\TournamentRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TournamentRepository::class)
*/
class Tournament
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="string", length=255)
*/
private string $name;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $apiKey = '';
/**
* @ORM\Column(type="boolean", options={"default"=1})
*/
private bool $isActive = true;
public function __construct()
{
$this->apiKey = sha1(time() * 27);
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getApiKey(): ?string
{
return $this->apiKey;
}
public function setApiKey(string $apiKey): self
{
$this->apiKey = $apiKey;
return $this;
}
public function isActive(): bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
}