src/Entity/Award.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AwardRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. /**
  7.  * @ORM\Entity(repositoryClass=AwardRepository::class)
  8.  */
  9. class Award
  10. {
  11.     use TimestampableEntity;
  12.     public const EXCHANGED 'exchanged';
  13.     public const NOT_EXCHANGED 'not_exchanged';
  14.     public const EXPIRED 'expired';
  15.     public const STATES = [self::EXCHANGEDself::NOT_EXCHANGED];
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Discount::class, inversedBy="awards")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $discount;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="awards")
  29.      */
  30.     private $user;
  31.     /**
  32.      * @ORM\Column(type="string", length=128)
  33.      */
  34.     private $status self::NOT_EXCHANGED;
  35.     /**
  36.      * @ORM\Column(type="datetime_immutable", nullable=true)
  37.      */
  38.     private $exchangedAt;
  39.     /**
  40.      * @ORM\Column(type="datetime_immutable", nullable=true)
  41.      */
  42.     private $captureAt;
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getDiscount(): ?Discount
  48.     {
  49.         return $this->discount;
  50.     }
  51.     public function setDiscount(?Discount $discount): self
  52.     {
  53.         $this->discount $discount;
  54.         return $this;
  55.     }
  56.     public function getUser(): ?User
  57.     {
  58.         return $this->user;
  59.     }
  60.     public function setUser(?User $user): self
  61.     {
  62.         $this->user $user;
  63.         return $this;
  64.     }
  65.     public function getStatus(): ?string
  66.     {
  67.         return $this->status;
  68.     }
  69.     public function setStatus(string $status): self
  70.     {
  71.         $this->status $status;
  72.         return $this;
  73.     }
  74.     public function getExchangedAt(): ?\DateTimeImmutable
  75.     {
  76.         return $this->exchangedAt;
  77.     }
  78.     public function setExchangedAt(?\DateTimeImmutable $exchangedAt): self
  79.     {
  80.         $this->exchangedAt $exchangedAt;
  81.         return $this;
  82.     }
  83.     public function getCaptureAt(): ?\DateTimeImmutable
  84.     {
  85.         return $this->captureAt;
  86.     }
  87.     public function setCaptureAt(?\DateTimeImmutable $captureAt): self
  88.     {
  89.         $this->captureAt $captureAt;
  90.         return $this;
  91.     }
  92. }