<?php
namespace App\Entity;
use App\Repository\AchievementRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
#[ORM\Entity(repositoryClass: AchievementRepository::class)]
class Achievement extends BaseKeyValue
{
use BlameableEntity; //Hook blameable behaviour. Updates createdBy, updatedBy fields
use TimestampableEntity; //Hook timestampable behaviour. Updates createdAt, updatedAt fields
const TUTORIAL_COMPLETE = 'TUTORIAL_COMPLETE';
const INTERESTS_COMPLETE = 'INTERESTS_COMPLETE';
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "IDENTITY")]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\ManyToOne(inversedBy: 'achievements')]
#[ORM\JoinColumn(nullable: false)]
private ?AchievementLevel $level = null;
/**
* Number of occurrences to obtain the achievement.
*/
#[ORM\Column]
private ?int $occurrences = 1;
public function getId(): ?int
{
return $this->id;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getLevel(): ?AchievementLevel
{
return $this->level;
}
public function setLevel(?AchievementLevel $level): self
{
$this->level = $level;
return $this;
}
public function getOccurrences(): ?int
{
return $this->occurrences;
}
public function setOccurrences(?int $occurrences): self
{
$this->occurrences = $occurrences;
return $this;
}
}