src/Entity/Jogos.php line 12
<?phpnamespace App\Entity;use App\Repository\JogosRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: JogosRepository::class)]class Jogos{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $nome = null;#[ORM\Column]private ?bool $ativo = null;#[ORM\OneToMany(mappedBy: 'Jogos', targetEntity: JogosUsuario::class)]private Collection $JogosUsuarios;#[ORM\OneToMany(mappedBy: 'Jogos', targetEntity: JogosParametros::class)]private Collection $JogosParametros;#[ORM\OneToMany(mappedBy: 'Jogos', targetEntity: JogosModelos::class)]private Collection $JogosModelos;#[ORM\OneToMany(mappedBy: 'Jogos', targetEntity: UserPalavras::class)]private Collection $UserPalavras;#[ORM\Column(type: Types::TEXT)]private ?string $imagem = null;const FUNCOES = ['Palavras Cruzadas' => ['resolver_palavra' => 1,'exibir_todas_letras' => 1,'mostrar_no_tabuleiro_letra' => 1,],'Palavra Escondida' => ['exibir_todas_letras' => 1,'exibir_dica' => 1],'Forca' => ['exibir_todas_letras' => 1,'exibir_dica' => 1]];public function __construct(){$this->JogosUsuarios = new ArrayCollection();$this->JogosParametros = new ArrayCollection();$this->JogosModelos = new ArrayCollection();$this->UserPalavras = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getNome(): ?string{return $this->nome;}public function setNome(string $nome): self{$this->nome = $nome;return $this;}public function isAtivo(): ?bool{return $this->ativo;}public function setAtivo(bool $ativo): self{$this->ativo = $ativo;return $this;}/*** @return Collection<int, JogosUsuario>*/public function getJogosUsuarios(): Collection{return $this->JogosUsuarios;}public function addJogosUsuario(JogosUsuario $jogosUsuario): self{if (!$this->JogosUsuarios->contains($jogosUsuario)) {$this->JogosUsuarios->add($jogosUsuario);$jogosUsuario->setJogos($this);}return $this;}public function removeJogosUsuario(JogosUsuario $jogosUsuario): self{if ($this->JogosUsuarios->removeElement($jogosUsuario)) {// set the owning side to null (unless already changed)if ($jogosUsuario->getJogos() === $this) {$jogosUsuario->setJogos(null);}}return $this;}/*** @return Collection<int, JogosParametros>*/public function getJogosParametros(): Collection{return $this->JogosParametros;}public function addJogosParametro(JogosParametros $jogosParametro): self{if (!$this->JogosParametros->contains($jogosParametro)) {$this->JogosParametros->add($jogosParametro);$jogosParametro->setJogos($this);}return $this;}public function removeJogosParametro(JogosParametros $jogosParametro): self{if ($this->JogosParametros->removeElement($jogosParametro)) {// set the owning side to null (unless already changed)if ($jogosParametro->getJogos() === $this) {$jogosParametro->setJogos(null);}}return $this;}public function clearJogosParametro(\Doctrine\ORM\EntityManager $em): self{$vet = $this->getJogosParametros();foreach($vet as $idx){$this->removeJogosParametro($idx);}$em->persist($this);$em->flush();return $this;}/*** @return Collection<int, JogosModelos>*/public function getJogosModelos(): Collection{return $this->JogosModelos;}public function addJogosModelo(JogosModelos $jogosModelo): self{if (!$this->JogosModelos->contains($jogosModelo)) {$this->JogosModelos->add($jogosModelo);$jogosModelo->setJogos($this);}return $this;}public function removeJogosModelo(JogosModelos $jogosModelo): self{if ($this->JogosModelos->removeElement($jogosModelo)) {// set the owning side to null (unless already changed)if ($jogosModelo->getJogos() === $this) {$jogosModelo->setJogos(null);}}return $this;}/*** @return Collection<int, UserPalavras>*/public function getUserPalavras(): Collection{return $this->UserPalavras;}public function addUserPalavra(UserPalavras $userPalavra): self{if (!$this->UserPalavras->contains($userPalavra)) {$this->UserPalavras->add($userPalavra);$userPalavra->setJogos($this);}return $this;}public function removeUserPalavra(UserPalavras $userPalavra): self{if ($this->UserPalavras->removeElement($userPalavra)) {// set the owning side to null (unless already changed)if ($userPalavra->getJogos() === $this) {$userPalavra->setJogos(null);}}return $this;}public function getImagem(): ?string{return $this->imagem;}public function setImagem(string $imagem): self{$this->imagem = $imagem;return $this;}}