src/Entity/JogosParametros.php line 12
<?phpnamespace App\Entity;use App\Repository\JogosParametrosRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use App\Util\Niveis;#[ORM\Entity(repositoryClass: JogosParametrosRepository::class)]class JogosParametros extends Niveis{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(nullable: true)]private ?int $pontos = null;#[ORM\Column(nullable: true)]private ?int $moedas = null;#[ORM\Column]private ?\DateTimeImmutable $created_at = null;#[ORM\Column(nullable: true)]private ?\DateTimeImmutable $updated_at = null;#[ORM\ManyToOne(inversedBy: 'JogosParametros')]private ?Jogos $Jogos = null;#[ORM\ManyToOne(inversedBy: 'JogosParametros')]private ?JogosRegras $JogosRegras = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $historico = null;#[ORM\Column(nullable: true)]private ?int $nivel = null;public function getId(): ?int{return $this->id;}public function getPontos(): ?int{return $this->pontos;}public function setPontos(?int $pontos): self{$this->pontos = $pontos;return $this;}public function getMoedas(): ?int{return $this->moedas;}public function setMoedas(?int $moedas): self{$this->moedas = $moedas;return $this;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->created_at;}public function setCreatedAt(): self{$this->created_at = new \DateTimeImmutable('now');return $this;}public function getUpdatedAt(): ?\DateTimeImmutable{return $this->updated_at;}public function setUpdatedAt(): self{$this->updated_at = new \DateTimeImmutable('now');return $this;}public function getJogos(): ?Jogos{return $this->Jogos;}public function setJogos(?Jogos $Jogos): self{$this->Jogos = $Jogos;return $this;}public function getJogosRegras(): ?JogosRegras{return $this->JogosRegras;}public function setJogosRegras(?JogosRegras $JogosRegras): self{$this->JogosRegras = $JogosRegras;return $this;}public function getHistorico(){return json_decode($this->historico, true);}public function setHistorico($historico): self{$this->historico = json_encode($historico);return $this;}public function getNivel(): ?int{return $this->nivel;}public function setNivel(int $nivel): self{if(!isset(self::TP_NIVEL[$nivel])){throw new \Exception('Nível não encontrado');}$this->nivel = $nivel;return $this;}public function getNiveldesc(){if(!isset(self::TP_NIVEL[$this->getNivel()])){return '';}return self::TP_NIVEL[$this->getNivel()]['label'];}}