src/Entity/Report/StripeSubscription.php line 14

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Report;
  4. use App\Repository\Report\StripeSubscriptionRepository;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=StripeSubscriptionRepository::class)
  9. */
  10. class StripeSubscription
  11. {
  12. /**
  13. * @ORM\Id
  14. *
  15. * @ORM\GeneratedValue
  16. *
  17. * @ORM\Column(type="integer")
  18. */
  19. private int $id;
  20. /**
  21. * @ORM\Column(type="string", length=255)
  22. */
  23. private string $externalSubscriptionId;
  24. /**
  25. * @ORM\Column(type="integer")
  26. */
  27. private int $productId;
  28. /**
  29. * @ORM\Column(type="string", length=255)
  30. */
  31. private string $externalProductId;
  32. /**
  33. * @ORM\Column(type="integer")
  34. */
  35. private int $customerId;
  36. /**
  37. * @ORM\Column(type="boolean")
  38. */
  39. private bool $active;
  40. /**
  41. * @ORM\Column(type="integer")
  42. */
  43. private ?int $subscriptionLineId;
  44. /**
  45. * @ORM\Column(type="integer")
  46. */
  47. private ?int $subscriptionCustomerId;
  48. /**
  49. * @ORM\Column(type="datetime")
  50. */
  51. private \DateTime $dateAdd;
  52. /**
  53. * @ORM\Column(type="datetime", nullable=true)
  54. */
  55. private ?\DateTime $dateUpd = null;
  56. /**
  57. * @ORM\Column(type="datetime")
  58. */
  59. private \DateTime $dateStart;
  60. /**
  61. * @ORM\Column(type="datetime", nullable=true)
  62. */
  63. private ?\DateTime $dateDue;
  64. /**
  65. * @ORM\Column(type="integer", name="attempts", nullable=true)
  66. */
  67. private ?int $attempts;
  68. /**
  69. * @ORM\Column(type="datetime", nullable=true)
  70. */
  71. private ?\DateTime $dateCancel = null;
  72. /**
  73. * @var StripeSubscriptionLog[]|Collection<int, StripeSubscriptionLog>
  74. *
  75. * @ORM\OneToMany(targetEntity=StripeSubscriptionLog::class, mappedBy="stripeSubscription")
  76. */
  77. private $stripeSubscriptionLogs;
  78. public function __construct()
  79. {
  80. $this->dateAdd = new \DateTime();
  81. }
  82. public function getId(): ?int
  83. {
  84. return $this->id;
  85. }
  86. public function getExternalSubscriptionId(): string
  87. {
  88. return $this->externalSubscriptionId;
  89. }
  90. public function setExternalSubscriptionId(string $externalSubscriptionId): StripeSubscription
  91. {
  92. $this->externalSubscriptionId = $externalSubscriptionId;
  93. return $this;
  94. }
  95. public function getProductId(): ?int
  96. {
  97. return $this->productId;
  98. }
  99. public function setProductId(int $productId): StripeSubscription
  100. {
  101. $this->productId = $productId;
  102. return $this;
  103. }
  104. public function getExternalProductId(): ?string
  105. {
  106. return $this->externalProductId;
  107. }
  108. public function setExternalProductId(string $externalProductId): StripeSubscription
  109. {
  110. $this->externalProductId = $externalProductId;
  111. return $this;
  112. }
  113. public function getCustomerId(): ?int
  114. {
  115. return $this->customerId;
  116. }
  117. public function setCustomerId(int $customerId): StripeSubscription
  118. {
  119. $this->customerId = $customerId;
  120. return $this;
  121. }
  122. public function isActive(): ?bool
  123. {
  124. return $this->active;
  125. }
  126. public function setActive(bool $active): StripeSubscription
  127. {
  128. $this->active = $active;
  129. return $this;
  130. }
  131. public function getSubscriptionLineId(): ?int
  132. {
  133. return $this->subscriptionLineId;
  134. }
  135. public function setSubscriptionLineId(?int $subscriptionLineId): StripeSubscription
  136. {
  137. $this->subscriptionLineId = $subscriptionLineId;
  138. return $this;
  139. }
  140. public function getSubscriptionCustomerId(): ?int
  141. {
  142. return $this->subscriptionCustomerId;
  143. }
  144. public function setSubscriptionCustomerId(?int $subscriptionCustomerId): StripeSubscription
  145. {
  146. $this->subscriptionCustomerId = $subscriptionCustomerId;
  147. return $this;
  148. }
  149. public function getDateAdd(): ?\DateTime
  150. {
  151. return $this->dateAdd;
  152. }
  153. public function setDateAdd(\DateTime $dateAdd): StripeSubscription
  154. {
  155. $this->dateAdd = $dateAdd;
  156. return $this;
  157. }
  158. public function getDateUpd(): ?\DateTime
  159. {
  160. return $this->dateUpd;
  161. }
  162. public function setDateUpd(?\DateTime $dateUpd): StripeSubscription
  163. {
  164. $this->dateUpd = $dateUpd;
  165. return $this;
  166. }
  167. public function getDateStart(): ?\DateTime
  168. {
  169. return $this->dateStart;
  170. }
  171. public function setDateStart(\DateTime $dateStart): StripeSubscription
  172. {
  173. $this->dateStart = $dateStart;
  174. return $this;
  175. }
  176. public function getDateDue(): ?\DateTime
  177. {
  178. return $this->dateDue;
  179. }
  180. public function setDateDue(?\DateTime $dateDue): StripeSubscription
  181. {
  182. $this->dateDue = $dateDue;
  183. return $this;
  184. }
  185. public function getAttempts(): ?int
  186. {
  187. return $this->attempts;
  188. }
  189. public function setAttempts(?int $attempts): StripeSubscription
  190. {
  191. $this->attempts = $attempts;
  192. return $this;
  193. }
  194. public function getDateCancel(): ?\DateTime
  195. {
  196. return $this->dateCancel;
  197. }
  198. public function setDateCancel(?\DateTime $dateCancel): StripeSubscription
  199. {
  200. $this->dateCancel = $dateCancel;
  201. return $this;
  202. }
  203. /**
  204. * @return StripeSubscriptionLog[]|Collection<int, StripeSubscriptionLog>
  205. */
  206. public function getStripeSubscriptionLogs()
  207. {
  208. return $this->stripeSubscriptionLogs;
  209. }
  210. public function addStripeSubscriptionLog(StripeSubscriptionLog $stripeSubscriptionLog): StripeSubscription
  211. {
  212. if (!$this->stripeSubscriptionLogs->contains($stripeSubscriptionLog)) {
  213. $this->stripeSubscriptionLogs[] = $stripeSubscriptionLog;
  214. $stripeSubscriptionLog->setStripeSubscription($this);
  215. }
  216. return $this;
  217. }
  218. public function removeStripeSubscriptionLog(StripeSubscriptionLog $stripeSubscriptionLog): StripeSubscription
  219. {
  220. if ($this->stripeSubscriptionLogs->removeElement($stripeSubscriptionLog)) {
  221. // set the owning side to null (unless already changed)
  222. if ($stripeSubscriptionLog->getStripeSubscription() === $this) {
  223. $stripeSubscriptionLog->setStripeSubscription(null);
  224. }
  225. }
  226. return $this;
  227. }
  228. }