src/Entity/Core/KvikCustomizationBuy.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core;
  3. use App\Entity\Core\Gamification\GamificationProfile;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JsonSerializable;
  7. #[ORM\Table('kvik_customization_buy')]
  8. #[ORM\Entity]
  9. class KvikCustomizationBuy implements JsonSerializable
  10. {
  11. /**
  12. * @var int
  13. */
  14. #[ORM\Column(name: 'id', type: 'integer')]
  15. #[ORM\Id]
  16. #[ORM\GeneratedValue(strategy: 'AUTO')]
  17. private int $id;
  18. /**
  19. * @var KvikCustomization
  20. */
  21. #[ORM\JoinColumn(name: 'kvik_customization', referencedColumnName: 'id', onDelete: 'CASCADE')]
  22. #[ORM\ManyToOne(targetEntity: KvikCustomization::class)]
  23. private KvikCustomization $kvikCustomization;
  24. /**
  25. * @var GamificationProfile
  26. */
  27. #[ORM\JoinColumn(name: 'gamification_profile', referencedColumnName: 'id', onDelete: 'CASCADE')]
  28. #[ORM\ManyToOne(targetEntity: GamificationProfile::class)]
  29. private GamificationProfile $gamificationProfile;
  30. /**
  31. * @var DateTime
  32. */
  33. #[ORM\Column(name: 'bought_at', type: 'datetime')]
  34. private DateTime $boughtAt;
  35. /**
  36. * @var int
  37. */
  38. #[ORM\Column(name: 'price_paid', type: 'integer')]
  39. private int $pricePaid;
  40. public function getId(): int
  41. {
  42. return $this->id;
  43. }
  44. public function setId(int $id): void
  45. {
  46. $this->id = $id;
  47. }
  48. public function getKvikCustomization(): KvikCustomization
  49. {
  50. return $this->kvikCustomization;
  51. }
  52. public function setKvikCustomization(KvikCustomization $kvikCustomization): void
  53. {
  54. $this->kvikCustomization = $kvikCustomization;
  55. }
  56. public function getGamificationProfile(): GamificationProfile
  57. {
  58. return $this->gamificationProfile;
  59. }
  60. public function setGamificationProfile(GamificationProfile $gamificationProfile): void
  61. {
  62. $this->gamificationProfile = $gamificationProfile;
  63. }
  64. public function getBoughtAt(): DateTime
  65. {
  66. return $this->boughtAt;
  67. }
  68. public function setBoughtAt(DateTime $boughtAt): void
  69. {
  70. $this->boughtAt = $boughtAt;
  71. }
  72. public function getPricePaid(): int
  73. {
  74. return $this->pricePaid;
  75. }
  76. public function setPricePaid(int $pricePaid): void
  77. {
  78. $this->pricePaid = $pricePaid;
  79. }
  80. public function jsonSerialize(): mixed
  81. {
  82. return [
  83. 'id' => $this->id,
  84. 'kvikCustomization' => $this->kvikCustomization,
  85. 'gamificationProfile' => $this->gamificationProfile,
  86. 'boughtAt' => $this->boughtAt,
  87. 'pricePaid' => $this->pricePaid,
  88. ];
  89. }
  90. }