src/Entity/TicketGratter.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TicketGratterRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassTicketGratterRepository::class)]
  7. class TicketGratter
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'ticketGratters')]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?User $user null;
  16.     #[ORM\ManyToOne(inversedBy'ticketGratters')]
  17.     private ?Offre $offre null;
  18.     #[ORM\Column]
  19.     private ?bool $isWinning null;
  20.     #[ORM\Column]
  21.     private ?bool $isScratched null;
  22.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  23.     private ?\DateTimeInterface $createdAt null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  25.     private ?\DateTimeInterface $scratchedAt null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $slug null;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $qrCodePath null;
  30.     #[ORM\Column]
  31.     private ?bool $active null;
  32.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  33.     private ?\DateTimeInterface $dateUsed null;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getUser(): ?User
  39.     {
  40.         return $this->user;
  41.     }
  42.     public function setUser(?User $user): static
  43.     {
  44.         $this->user $user;
  45.         return $this;
  46.     }
  47.     public function getOffre(): ?Offre
  48.     {
  49.         return $this->offre;
  50.     }
  51.     public function setOffre(?Offre $offre): static
  52.     {
  53.         $this->offre $offre;
  54.         return $this;
  55.     }
  56.     public function isIsWinning(): ?bool
  57.     {
  58.         return $this->isWinning;
  59.     }
  60.     public function setIsWinning(bool $isWinning): static
  61.     {
  62.         $this->isWinning $isWinning;
  63.         return $this;
  64.     }
  65.     public function isIsScratched(): ?bool
  66.     {
  67.         return $this->isScratched;
  68.     }
  69.     public function setIsScratched(bool $isScratched): static
  70.     {
  71.         $this->isScratched $isScratched;
  72.         return $this;
  73.     }
  74.     public function getCreatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->createdAt;
  77.     }
  78.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  79.     {
  80.         $this->createdAt $createdAt;
  81.         return $this;
  82.     }
  83.     public function getScratchedAt(): ?\DateTimeInterface
  84.     {
  85.         return $this->scratchedAt;
  86.     }
  87.     public function setScratchedAt(?\DateTimeInterface $scratchedAt): static
  88.     {
  89.         $this->scratchedAt $scratchedAt;
  90.         return $this;
  91.     }
  92.     public function getSlug(): ?string
  93.     {
  94.         return $this->slug;
  95.     }
  96.     public function setSlug(string $slug): static
  97.     {
  98.         $this->slug $slug;
  99.         return $this;
  100.     }
  101.     public function getQrCodePath(): ?string
  102.     {
  103.         return $this->qrCodePath;
  104.     }
  105.     public function setQrCodePath(?string $qrCodePath): static
  106.     {
  107.         $this->qrCodePath $qrCodePath;
  108.         return $this;
  109.     }
  110.     public function getExpirationDate(): \DateTime
  111.     {
  112.         $expirationDate = clone $this->scratchedAt;
  113.         return $expirationDate->modify('+2 month');
  114.     }
  115.     public function getTypeEntity(): string
  116.     {
  117.         return 'ticket';
  118.     }
  119.     public function isActive(): ?bool
  120.     {
  121.         return $this->active;
  122.     }
  123.     public function setActive(bool $active): static
  124.     {
  125.         $this->active $active;
  126.         return $this;
  127.     }
  128.     public function getDateUsed(): ?\DateTimeInterface
  129.     {
  130.         return $this->dateUsed;
  131.     }
  132.     public function setDateUsed(?\DateTimeInterface $dateUsed): static
  133.     {
  134.         $this->dateUsed $dateUsed;
  135.         return $this;
  136.     }
  137. }