src/Entity/WoltCoupon.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WoltCouponRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7. * @ORM\Entity(repositoryClass=WoltCouponRepository::class)
  8. */
  9. class WoltCoupon
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. * @Groups({"WoltCouponList"})
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255, nullable=true)
  20. * @Groups({"WoltCouponList"})
  21. */
  22. private $code;
  23. /**
  24. * @ORM\Column(type="boolean", nullable=true)
  25. * @Groups({"WoltCouponList"})
  26. */
  27. private $used = false;
  28. /**
  29. * @ORM\Column(type="datetime", nullable=true)
  30. * @Groups({"WoltCouponList"})
  31. */
  32. private $dateAdd;
  33. /**
  34. * @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="woltCoupons")
  35. * @Groups({"WoltCouponList"})
  36. */
  37. private $teacher;
  38. /**
  39. * @ORM\Column(type="datetime", nullable=true)
  40. * @Groups({"WoltCouponList"})
  41. */
  42. private $usedAt;
  43. /**
  44. * @ORM\Column(type="datetime", nullable=true)
  45. * @Groups({"WoltCouponList"})
  46. */
  47. private $validTo;
  48. public function __construct()
  49. {
  50. $this->dateAdd = new \DateTime();
  51. }
  52. public function getId(): ?int
  53. {
  54. return $this->id;
  55. }
  56. public function getCode(): ?string
  57. {
  58. return $this->code;
  59. }
  60. public function setCode(?string $code): self
  61. {
  62. $this->code = $code;
  63. return $this;
  64. }
  65. public function isUsed(): ?bool
  66. {
  67. return $this->used;
  68. }
  69. public function setUsed(?bool $used): self
  70. {
  71. $this->used = $used;
  72. return $this;
  73. }
  74. public function getDateAdd(): ?\DateTimeInterface
  75. {
  76. return $this->dateAdd;
  77. }
  78. public function setDateAdd(?\DateTimeInterface $dateAdd): self
  79. {
  80. $this->dateAdd = $dateAdd;
  81. return $this;
  82. }
  83. public function getTeacher(): ?Teacher
  84. {
  85. return $this->teacher;
  86. }
  87. public function setTeacher(?Teacher $teacher): self
  88. {
  89. $this->teacher = $teacher;
  90. return $this;
  91. }
  92. public function getUsedAt(): ?\DateTimeInterface
  93. {
  94. return $this->usedAt;
  95. }
  96. public function setUsedAt(?\DateTimeInterface $usedAt): self
  97. {
  98. $this->usedAt = $usedAt;
  99. return $this;
  100. }
  101. public function getValidTo(): ?\DateTimeInterface
  102. {
  103. return $this->validTo;
  104. }
  105. public function setValidTo(?\DateTimeInterface $validTo): self
  106. {
  107. $this->validTo = $validTo;
  108. return $this;
  109. }
  110. }