src/Entity/Application/Points.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Application;
  3. use App\Entity\Client;
  4. use App\Repository\Application\PointsRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JMS\Serializer\Annotation as Serializer;
  7. /**
  8. * @ORM\Table(name="app_points")
  9. * @ORM\Entity(repositoryClass=PointsRepository::class)
  10. */
  11. class Points
  12. {
  13. public const MAKE = 1;
  14. public const SPEND = -1;
  15. /**
  16. * @ORM\Id
  17. * @ORM\GeneratedValue
  18. * @ORM\Column(type="integer")
  19. */
  20. private $id;
  21. /**
  22. * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="pointsHistory")
  23. * @ORM\JoinColumn(nullable=false)
  24. */
  25. private $client;
  26. /**
  27. * @Serializer\Groups({"pointsHistory"})
  28. * @Serializer\SerializedName("store")
  29. * @ORM\ManyToOne(targetEntity=Store::class, inversedBy="pointsHistory")
  30. */
  31. private $store;
  32. /**
  33. * @Serializer\Groups({"pointsHistory"})
  34. * @Serializer\SerializedName("type")
  35. * @ORM\Column(type="integer")
  36. */
  37. private $type;
  38. /**
  39. * @Serializer\Groups({"pointsHistory"})
  40. * @Serializer\SerializedName("points")
  41. * @ORM\Column(type="integer")
  42. */
  43. private $points;
  44. /**
  45. * @ORM\Column(type="integer")
  46. */
  47. private $beforePoints;
  48. /**
  49. * @ORM\Column(type="integer")
  50. */
  51. private $afterPoints;
  52. /**
  53. * @Serializer\Groups({"pointsHistory"})
  54. * @Serializer\SerializedName("bonus")
  55. * @ORM\ManyToOne(targetEntity=Bonus::class, inversedBy="pointsHistory")
  56. */
  57. private $bonus;
  58. /**
  59. * @Serializer\Groups({"pointsHistory"})
  60. * @Serializer\SerializedName("date")
  61. *
  62. * @ORM\Column(type="datetime")
  63. */
  64. private $createts;
  65. public function getId(): ?int
  66. {
  67. return $this->id;
  68. }
  69. public function getClient(): ?Client
  70. {
  71. return $this->client;
  72. }
  73. public function setClient(?Client $client): self
  74. {
  75. $this->client = $client;
  76. return $this;
  77. }
  78. public function getStore(): ?Store
  79. {
  80. return $this->store;
  81. }
  82. public function setStore(?Store $store): self
  83. {
  84. $this->store = $store;
  85. return $this;
  86. }
  87. public function getType(): ?int
  88. {
  89. return $this->type;
  90. }
  91. public function setType(int $type): self
  92. {
  93. $this->type = $type;
  94. return $this;
  95. }
  96. public function getPoints(): ?int
  97. {
  98. return $this->points;
  99. }
  100. public function setPoints(int $points): self
  101. {
  102. $this->points = $points;
  103. return $this;
  104. }
  105. public function getBeforePoints(): ?int
  106. {
  107. return $this->beforePoints;
  108. }
  109. public function setBeforePoints(int $beforePoints): self
  110. {
  111. $this->beforePoints = $beforePoints;
  112. return $this;
  113. }
  114. public function getAfterPoints(): ?int
  115. {
  116. return $this->afterPoints;
  117. }
  118. public function setAfterPoints(int $afterPoints): self
  119. {
  120. $this->afterPoints = $afterPoints;
  121. return $this;
  122. }
  123. public function getBonus(): ?Bonus
  124. {
  125. return $this->bonus;
  126. }
  127. public function setBonus(?Bonus $bonus): self
  128. {
  129. $this->bonus = $bonus;
  130. return $this;
  131. }
  132. public function getCreatets(): ?\DateTimeInterface
  133. {
  134. return $this->createts;
  135. }
  136. public function setCreatets(\DateTimeInterface $createts): self
  137. {
  138. $this->createts = $createts;
  139. return $this;
  140. }
  141. }