src/Entity/Subscription.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SubscriptionRepository;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass=SubscriptionRepository::class)
  8. */
  9. class Subscription
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. */
  16. private ?int $id = NULL;
  17. /**
  18. * @ORM\OneToMany(targetEntity=UserSubscription::class, mappedBy="subscription", cascade={"remove"})
  19. */
  20. private Collection $userSubscriptions;
  21. /**
  22. * @ORM\Column(type="string", length=255)
  23. */
  24. private ?string $name = NULL;
  25. /**
  26. * @ORM\Column(type="integer")
  27. */
  28. private ?int $monthDuration = NULL;
  29. /**
  30. * @ORM\Column(type="boolean")
  31. */
  32. private bool $isDefault = FALSE;
  33. public function __toString()
  34. {
  35. return $this->getName();
  36. }
  37. public function getId(): ?int
  38. {
  39. return $this->id;
  40. }
  41. public function getName(): ?string
  42. {
  43. return $this->name;
  44. }
  45. public function setName(string $name): self
  46. {
  47. $this->name = $name;
  48. return $this;
  49. }
  50. public function getMonthDuration(): ?int
  51. {
  52. return $this->monthDuration;
  53. }
  54. public function setMonthDuration(int $monthDuration): self
  55. {
  56. $this->monthDuration = $monthDuration;
  57. return $this;
  58. }
  59. public function isIsDefault(): ?bool
  60. {
  61. return $this->isDefault;
  62. }
  63. public function setIsDefault(bool $isDefault): self
  64. {
  65. $this->isDefault = $isDefault;
  66. return $this;
  67. }
  68. /**
  69. * @return Collection
  70. */
  71. public function getUserSubscriptions(): Collection
  72. {
  73. return $this->userSubscriptions;
  74. }
  75. /**
  76. * @param Collection $userSubscriptions
  77. */
  78. public function setUserSubscriptions(Collection $userSubscriptions): void
  79. {
  80. $this->userSubscriptions = $userSubscriptions;
  81. }
  82. }