src/Entity/Core/KvikCustomization.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use JsonSerializable;
  5. #[ORM\Table('kvik_customization')]
  6. #[ORM\Entity]
  7. class KvikCustomization implements JsonSerializable
  8. {
  9. /**
  10. * @var int
  11. */
  12. #[ORM\Column(name: 'id', type: 'integer')]
  13. #[ORM\Id]
  14. #[ORM\GeneratedValue(strategy: 'AUTO')]
  15. private int $id;
  16. /**
  17. * @var string
  18. */
  19. #[ORM\Column(name: 'type', type: 'text', length: 16)]
  20. private string $type;
  21. /**
  22. * @var ?string
  23. */
  24. #[ORM\Column(name: 'sub_type', type: 'text', length: 16, nullable: true)]
  25. private ?string $subType;
  26. /**
  27. * @var string
  28. */
  29. #[ORM\Column(name: 'variant', type: 'text', length: 64)]
  30. private string $variant;
  31. /**
  32. * @var string
  33. */
  34. #[ORM\Column(name: 'name', type: 'text', length: 64)]
  35. private string $name;
  36. /**
  37. * @var ?int
  38. */
  39. #[ORM\Column(name: 'price', type: 'integer', nullable: true)]
  40. private ?int $price;
  41. /**
  42. * @var string
  43. */
  44. #[ORM\Column(name: 'explicitly_allowed_classrooms', type: 'text', length: 64)]
  45. private string $explicitlyAllowedClassrooms;
  46. public function getExplicitlyAllowedClassrooms(): string
  47. {
  48. return $this->explicitlyAllowedClassrooms;
  49. }
  50. public function setExplicitlyAllowedClassrooms(string $explicitlyAllowedClassrooms): void
  51. {
  52. $this->explicitlyAllowedClassrooms = $explicitlyAllowedClassrooms;
  53. }
  54. public function getId(): int
  55. {
  56. return $this->id;
  57. }
  58. public function setId(int $id): void
  59. {
  60. $this->id = $id;
  61. }
  62. public function getType(): string
  63. {
  64. return $this->type;
  65. }
  66. public function setType(string $type): void
  67. {
  68. $this->type = $type;
  69. }
  70. public function getSubType(): ?string
  71. {
  72. return $this->subType;
  73. }
  74. public function setSubType(?string $subType): void
  75. {
  76. $this->subType = $subType;
  77. }
  78. public function getVariant(): string
  79. {
  80. return $this->variant;
  81. }
  82. public function setVariant(string $variant): void
  83. {
  84. $this->variant = $variant;
  85. }
  86. public function getName(): ?string
  87. {
  88. return $this->name;
  89. }
  90. public function setName(?string $name): void
  91. {
  92. $this->name = $name;
  93. }
  94. public function getPrice(): ?int
  95. {
  96. return $this->price;
  97. }
  98. public function setPrice(?int $price): void
  99. {
  100. $this->price = $price;
  101. }
  102. public function jsonSerialize(): array
  103. {
  104. return [
  105. 'id' => $this->id,
  106. 'type' => $this->type,
  107. 'subType' => $this->subType,
  108. 'variant' => $this->variant,
  109. 'name' => $this->name,
  110. 'price' => $this->price,
  111. 'explicitlyAllowedClassroomsArray' => explode(',', $this->explicitlyAllowedClassrooms)
  112. ];
  113. }
  114. }