src/Entity/Palavra.php line 19
<?phpnamespace App\Entity;use Gedmo\Mapping\Annotation as Gedmo;use App\Repository\PalavraRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Doctrine\DBAL\Types\Types;/*** @ORM\Entity* @Gedmo\SoftDeleteable(fieldName="deleted_at", timeAware=false, hardDelete=false)*/#[ORM\Entity(repositoryClass: PalavraRepository::class)]#[Gedmo\SoftDeleteable(fieldName: 'deleted_at', timeAware: false, hardDelete: false)]class Palavra{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $palavra = null;#[ORM\Column(length: 255)]private ?string $palavracrua = null;#[ORM\Column]private ?bool $ativo = null;#[ORM\Column(type: Types::INTEGER, nullable: true)]private ?int $tamanho = null;#[ORM\Column(length: 1)]private ?string $inicial = null;#[ORM\ManyToMany(targetEntity: Categoria::class, inversedBy: 'Palavras')]private Collection $Categorias;#[ORM\Column(length: 255)]private ?string $dica = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $created_at = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $updated_at = null;#[ORM\OneToMany(mappedBy: 'Palavra', targetEntity: UserPalavras::class)]private Collection $UserPalavras;#[ORM\Column]private ?bool $nivel0 = null;#[ORM\Column]private ?bool $nivel1 = null;#[ORM\Column]private ?bool $nivel2 = null;#[ORM\Column]private ?bool $nivel3 = null;#[ORM\Column]private ?bool $nivel4 = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $dtDicaChatgpt = null;#[ORM\Column(nullable: true)]private ?\DateTimeImmutable $deleted_at = null;#[ORM\OneToMany(mappedBy: 'teste', targetEntity: Jogos::class)]private Collection $jogos;public function __construct(){$this->Categorias = new ArrayCollection();$this->UserPalavras = new ArrayCollection();$this->jogos = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getPalavra(): ?string{return $this->palavra;}public function setPalavra(string $palavra): self{$this->palavra = $palavra;return $this;}public function getPalavracrua(): ?string{return $this->palavracrua;}public function setPalavracrua(string $palavra): self{$this->palavracrua = $palavra;return $this;}public function isAtivo(): ?bool{return $this->ativo;}public function setAtivo(bool $ativo): self{$this->ativo = $ativo;return $this;}public function getTamanho(): ?int{return $this->tamanho;}public function setTamanho(int $tamanho): self{$this->tamanho = $tamanho;return $this;}public function getInicial(): ?string{return $this->inicial;}public function setInicial(string $inicial): self{$this->inicial = $inicial;return $this;}/*** @return Collection<int, Categorias>*/public function getCategorias(): Collection{return $this->Categorias;}public function addCategoria(Categoria $categoria): self{if (!$this->Categorias->contains($categoria)) {$this->Categorias->add($categoria);}return $this;}public function removeCategoria(Categoria $categoria): self{$this->Categorias->removeElement($categoria);return $this;}public function clearCategoria(\Doctrine\ORM\EntityManager $em): self{$vetCategorias = $this->getCategorias();foreach($vetCategorias as $categoria){$this->removeCategoria($categoria);}$em->persist($this);$em->flush();return $this;}public function getDica(): ?string{return $this->dica;}public function setDica(string $dica): self{$this->dica = $dica;return $this;}public function getCreatedAt(): ?\DateTimeInterface{return $this->created_at;}public function setCreatedAt(): self{$this->created_at = new \DateTime('now');return $this;}public function getUpdatedAt(): ?\DateTimeInterface{return $this->updated_at;}public function setUpdatedAt(): self{$this->updated_at = new \DateTime('now');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->setPalavra($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->getPalavra() === $this) {$userPalavra->setPalavra(null);}}return $this;}public function isNivel0(): ?bool{return $this->nivel0;}public function setNivel0(bool $nivel0): self{$this->nivel0 = $nivel0;return $this;}public function isNivel1(): ?bool{return $this->nivel1;}public function setNivel1(bool $nivel1): self{$this->nivel1 = $nivel1;return $this;}public function isNivel2(): ?bool{return $this->nivel2;}public function setNivel2(bool $nivel2): self{$this->nivel2 = $nivel2;return $this;}public function isNivel3(): ?bool{return $this->nivel3;}public function setNivel3(bool $nivel3): self{$this->nivel3 = $nivel3;return $this;}public function isNivel4(): ?bool{return $this->nivel4;}public function setNivel4(bool $nivel4): self{$this->nivel4 = $nivel4;return $this;}public function resetNiveis(): self{$this->nivel0 = false;$this->nivel1 = false;$this->nivel2 = false;$this->nivel3 = false;$this->nivel4 = false;return $this;}public function getNiveis(){$r = [];if($this->isNivel0()){$r[] = \App\Util\Niveis::getNivelByKey(0);}if($this->isNivel1()){$r[] = \App\Util\Niveis::getNivelByKey(1);}if($this->isNivel2()){$r[] = \App\Util\Niveis::getNivelByKey(2);}if($this->isNivel3()){$r[] = \App\Util\Niveis::getNivelByKey(3);}if($this->isNivel4()){$r[] = \App\Util\Niveis::getNivelByKey(4);}return $r;}public function getDtDicaChatgpt(): ?\DateTimeInterface{return $this->dtDicaChatgpt;}public function setDtDicaChatgpt(): self{$this->dtDicaChatgpt = new \DateTime('now');return $this;}public function getDeletedAt(): ?\DateTimeImmutable{return $this->deleted_at;}public function setDeletedAt(\DateTimeImmutable $deleted_at): self{$this->deleted_at = $deleted_at;return $this;}/*** @return Collection<int, Jogos>*/public function getJogos(): Collection{return $this->jogos;}public function addJogo(Jogos $jogo): static{if (!$this->jogos->contains($jogo)) {$this->jogos->add($jogo);$jogo->setTeste($this);}return $this;}public function removeJogo(Jogos $jogo): static{if ($this->jogos->removeElement($jogo)) {// set the owning side to null (unless already changed)if ($jogo->getTeste() === $this) {$jogo->setTeste(null);}}return $this;}}