src/Entity/Achievement.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AchievementRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Blameable\Traits\BlameableEntity;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. #[ORM\Entity(repositoryClassAchievementRepository::class)]
  9. class Achievement extends BaseKeyValue
  10. {
  11.     use BlameableEntity//Hook blameable behaviour. Updates createdBy, updatedBy fields
  12.     use TimestampableEntity//Hook timestampable behaviour. Updates createdAt, updatedAt fields 
  13.     
  14.     
  15.     const TUTORIAL_COMPLETE 'TUTORIAL_COMPLETE';
  16.     const INTERESTS_COMPLETE 'INTERESTS_COMPLETE';
  17.     
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\Column(typeTypes::TEXT)]
  23.     private ?string $description null;
  24.     #[ORM\ManyToOne(inversedBy'achievements')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private ?AchievementLevel $level null;
  27.     /**
  28.      * Number of occurrences to obtain the achievement.
  29.      */
  30.     #[ORM\Column]
  31.     private ?int $occurrences 1;
  32.     
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getDescription(): ?string
  38.     {
  39.         return $this->description;
  40.     }
  41.     public function setDescription(string $description): self
  42.     {
  43.         $this->description $description;
  44.         return $this;
  45.     }
  46.     public function getLevel(): ?AchievementLevel
  47.     {
  48.         return $this->level;
  49.     }
  50.     public function setLevel(?AchievementLevel $level): self
  51.     {
  52.         $this->level $level;
  53.         return $this;
  54.     }
  55.     public function getOccurrences(): ?int
  56.     {
  57.         return $this->occurrences;
  58.     }
  59.     public function setOccurrences(?int $occurrences): self
  60.     {
  61.         $this->occurrences $occurrences;
  62.         return $this;
  63.     }
  64. }