src/Entity/Plan.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PlanRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass: PlanRepository::class)]
  7. #[ORM\Table(name: 'plans')]
  8. class Plan
  9. {
  10. #[ORM\Id]
  11. #[ORM\GeneratedValue]
  12. #[ORM\Column]
  13. private ?int $id = null;
  14. #[ORM\Column(length: 100)]
  15. private ?string $name = null;
  16. #[ORM\Column(length: 50)]
  17. private ?string $cpu = null;
  18. #[ORM\Column(length: 50)]
  19. private ?string $ram = null;
  20. #[ORM\Column(length: 100)]
  21. private ?string $storage = null;
  22. #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]
  23. private ?string $price = null;
  24. #[ORM\Column]
  25. private ?bool $popular = false;
  26. #[ORM\Column(length: 50, nullable: true)]
  27. private ?string $category = null; // e.g. 'kvm', 'dedicated'
  28. #[ORM\Column(nullable: true)]
  29. private ?int $sortOrder = null;
  30. // Getters & Setters
  31. public function getId(): ?int
  32. {
  33. return $this->id;
  34. }
  35. public function getName(): ?string
  36. {
  37. return $this->name;
  38. }
  39. public function setName(string $name): static
  40. {
  41. $this->name = $name;
  42. return $this;
  43. }
  44. public function getCpu(): ?string
  45. {
  46. return $this->cpu;
  47. }
  48. public function setCpu(string $cpu): static
  49. {
  50. $this->cpu = $cpu;
  51. return $this;
  52. }
  53. public function getRam(): ?string
  54. {
  55. return $this->ram;
  56. }
  57. public function setRam(string $ram): static
  58. {
  59. $this->ram = $ram;
  60. return $this;
  61. }
  62. public function getStorage(): ?string
  63. {
  64. return $this->storage;
  65. }
  66. public function setStorage(string $storage): static
  67. {
  68. $this->storage = $storage;
  69. return $this;
  70. }
  71. public function getPrice(): ?string
  72. {
  73. return $this->price;
  74. }
  75. public function setPrice(string $price): static
  76. {
  77. $this->price = $price;
  78. return $this;
  79. }
  80. public function isPopular(): ?bool
  81. {
  82. return $this->popular;
  83. }
  84. public function setPopular(bool $popular): static
  85. {
  86. $this->popular = $popular;
  87. return $this;
  88. }
  89. public function getCategory(): ?string
  90. {
  91. return $this->category;
  92. }
  93. public function setCategory(?string $category): static
  94. {
  95. $this->category = $category;
  96. return $this;
  97. }
  98. public function getSortOrder(): ?int
  99. {
  100. return $this->sortOrder;
  101. }
  102. public function setSortOrder(?int $sortOrder): static
  103. {
  104. $this->sortOrder = $sortOrder;
  105. return $this;
  106. }
  107. #[ORM\Column(options: ['default' => false])]
  108. private ?bool $soldOut = false;
  109. #[ORM\Column(options: ['default' => false])]
  110. private ?bool $trialEnabled = false;
  111. public function isSoldOut(): ?bool
  112. {
  113. return $this->soldOut;
  114. }
  115. public function setSoldOut(bool $soldOut): static
  116. {
  117. $this->soldOut = $soldOut;
  118. return $this;
  119. }
  120. public function isTrialEnabled(): ?bool
  121. {
  122. return $this->trialEnabled;
  123. }
  124. public function setTrialEnabled(bool $trialEnabled): static
  125. {
  126. $this->trialEnabled = $trialEnabled;
  127. return $this;
  128. }
  129. }