src/Entity/QuotasProductFree.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\QuotasProductFreeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=QuotasProductFreeRepository::class)
  9. */
  10. class QuotasProductFree
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private ?int $id = null;
  18. /**
  19. * @ORM\Column(type="boolean")
  20. */
  21. private bool $enabled = true;
  22. /**
  23. * @ORM\Column(type="string", length=255)
  24. */
  25. private ?string $label = null;
  26. /**
  27. * @ORM\Column(type="integer", nullable=true)
  28. */
  29. private ?int $quotasMonthInterval = null;
  30. /**
  31. * @ORM\Column(type="datetime", nullable=true)
  32. */
  33. private ?\DateTimeInterface $dateStart = null;
  34. /**
  35. * @ORM\Column(type="datetime", nullable=true)
  36. */
  37. private ?\DateTimeInterface $dateEnd = null;
  38. /**
  39. * @ORM\ManyToMany(targetEntity=User::class, inversedBy="quotaProductFrees")
  40. *
  41. * @var Collection<int, User>
  42. */
  43. private Collection $users;
  44. /**
  45. * @ORM\Column(type="text", nullable=true)
  46. */
  47. private ?string $jobs = null;
  48. /**
  49. * @ORM\Column(type="text", nullable=true)
  50. */
  51. private ?string $roles = null;
  52. /**
  53. * @ORM\Column(type="integer")
  54. */
  55. private ?int $quota = null;
  56. /**
  57. * @ORM\ManyToOne(targetEntity=CustomProduct::class, inversedBy="quotaProductFrees")
  58. * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  59. */
  60. private ?CustomProduct $customProduct = null;
  61. public function __construct()
  62. {
  63. $this->users = new ArrayCollection();
  64. }
  65. public function getId(): ?int
  66. {
  67. return $this->id;
  68. }
  69. public function isEnabled(): bool
  70. {
  71. return $this->enabled;
  72. }
  73. public function setEnabled(bool $enabled): self
  74. {
  75. $this->enabled = $enabled;
  76. return $this;
  77. }
  78. public function getLabel(): ?string
  79. {
  80. return $this->label;
  81. }
  82. public function setLabel(string $label): self
  83. {
  84. $this->label = $label;
  85. return $this;
  86. }
  87. public function getQuotasMonthInterval(): ?int
  88. {
  89. return $this->quotasMonthInterval;
  90. }
  91. public function setQuotasMonthInterval(?int $quotasMonthInterval): self
  92. {
  93. $this->quotasMonthInterval = $quotasMonthInterval;
  94. return $this;
  95. }
  96. public function getDateStart(): ?\DateTimeInterface
  97. {
  98. return $this->dateStart;
  99. }
  100. public function setDateStart(?\DateTimeInterface $dateStart): self
  101. {
  102. $this->dateStart = $dateStart;
  103. return $this;
  104. }
  105. public function getDateEnd(): ?\DateTimeInterface
  106. {
  107. return $this->dateEnd;
  108. }
  109. public function setDateEnd(?\DateTimeInterface $dateEnd): self
  110. {
  111. $this->dateEnd = $dateEnd;
  112. return $this;
  113. }
  114. /**
  115. * @return Collection<int, User>
  116. */
  117. public function getUsers(): Collection
  118. {
  119. return $this->users;
  120. }
  121. public function addUser(User $user): self
  122. {
  123. if (!$this->users->contains($user)) {
  124. $this->users->add($user);
  125. $user->addQuotaProductFree($this);
  126. }
  127. return $this;
  128. }
  129. public function removeUser(User $user): self
  130. {
  131. if ($this->users->removeElement($user)) {
  132. $user->removeQuotaProductFree($this);
  133. }
  134. return $this;
  135. }
  136. public function getJobs(): ?string
  137. {
  138. return $this->jobs;
  139. }
  140. public function setJobs(?string $jobs): self
  141. {
  142. $this->jobs = $jobs;
  143. return $this;
  144. }
  145. public function getRoles(): ?string
  146. {
  147. return $this->roles;
  148. }
  149. public function setRoles(?string $roles): self
  150. {
  151. $this->roles = $roles;
  152. return $this;
  153. }
  154. public function getQuota(): ?int
  155. {
  156. return $this->quota;
  157. }
  158. public function setQuota(int $quota): self
  159. {
  160. $this->quota = $quota;
  161. return $this;
  162. }
  163. public function getCustomProduct(): ?CustomProduct
  164. {
  165. return $this->customProduct;
  166. }
  167. public function setCustomProduct(?CustomProduct $customProduct): self
  168. {
  169. $this->customProduct = $customProduct;
  170. return $this;
  171. }
  172. }