src/Entity/Code.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimestampableTrait;
  4. use App\Repository\CodeRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  8. #[ORM\Entity(repositoryClassCodeRepository::class)]
  9. class Code
  10. {
  11.     const LOT_LABELS = [
  12.         'PAL01' => 'Cave à vin',
  13.         'PAL02' => "Bon d'achat de 50€",
  14.         'PAL03' => 'Cours de cuisine',
  15.         'PAL04' => 'Webcoupon',
  16.     ];
  17.     use TimestampableTrait;
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\Column(length30uniquetrue)]
  23.     private ?string $code null;
  24.     #[ORM\Column(nullabletrue)]
  25.     private ?\DateTimeImmutable $usedAt null;
  26.     #[ORM\Column(options: ['default' => false])]
  27.     private bool $burned false;
  28.     private ?string $file null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $palier null;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getCode(): ?string
  36.     {
  37.         return $this->code;
  38.     }
  39.     public function setCode(string $code): self
  40.     {
  41.         $this->code $code;
  42.         return $this;
  43.     }
  44.     public function getUsedAt(): ?\DateTimeImmutable
  45.     {
  46.         return $this->usedAt;
  47.     }
  48.     public function setUsedAt(\DateTimeImmutable $usedAt): self
  49.     {
  50.         $this->usedAt $usedAt;
  51.         return $this;
  52.     }
  53.     public function isBurned(): bool
  54.     {
  55.         return $this->burned;
  56.     }
  57.     public function setBurned(bool $burned): Code
  58.     {
  59.         $this->burned $burned;
  60.         return $this;
  61.     }
  62.     public function getFile(): ?string
  63.     {
  64.         return $this->file;
  65.     }
  66.     public function setFile(?string $file): Code
  67.     {
  68.         $this->file $file;
  69.         return $this;
  70.     }
  71.     public function getPalier(): ?string
  72.     {
  73.         return $this->palier;
  74.     }
  75.     public function setPalier(?string $palier): static
  76.     {
  77.         $this->palier $palier;
  78.         return $this;
  79.     }
  80. }