src/Entity/Badge.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Entity;
  7. use Doctrine\ORM\Mapping\GeneratedValue;
  8. use Doctrine\ORM\Mapping\Id;
  9. #[ApiResource(attributes: ['route_prefix' => 'v1'])]
  10. #[Entity]
  11. class Badge
  12. {
  13.     #[Id]
  14.     #[GeneratedValue]
  15.     #[Column(type'integer'nullablefalseoptions: ['unsigned' => true])]
  16.     private ?int $id null;
  17.     #[Column(type'integer'nullablefalseoptions: ['unsigned' => true])]
  18.     private int $weight;
  19.     #[Column(type'string'nullabletrue)]
  20.     private ?string $file null;
  21.     #[Column(type'string')]
  22.     private string $description;
  23.     #[Column(type'text')]
  24.     private string $expression;
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function setWeight(int $weight): static
  30.     {
  31.         $this->weight $weight;
  32.         return $this;
  33.     }
  34.     public function getWeight(): int
  35.     {
  36.         return $this->weight;
  37.     }
  38.     public function setFile(?string $file): static
  39.     {
  40.         $this->file $file;
  41.         return $this;
  42.     }
  43.     public function getFile(): ?string
  44.     {
  45.         return $this->file;
  46.     }
  47.     public function setDescription(string $description): static
  48.     {
  49.         $this->description $description;
  50.         return $this;
  51.     }
  52.     public function getDescription(): string
  53.     {
  54.         return $this->description;
  55.     }
  56.     public function setExpression(string $expression): static
  57.     {
  58.         $this->expression $expression;
  59.         return $this;
  60.     }
  61.     public function getExpression(): string
  62.     {
  63.         return $this->expression;
  64.     }
  65. }