src/Entity/System/SubscriptionLineHistory.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * SubscriptionLine
  8. *
  9. * @ORM\Table(name="subscriptions_lines_history", indexes={
  10. *
  11. * @ORM\Index(name="id_subscription_paypal", columns={"id_subscription_paypal"}),
  12. * @ORM\Index(name="name", columns={"name"})
  13. * })
  14. *
  15. * @ORM\Entity(repositoryClass="App\Repository\System\SubscriptionLineHistoryRepository")
  16. */
  17. class SubscriptionLineHistory
  18. {
  19. public const STATUS_CANCEL = 'Cancel';
  20. public const STATUS_ERROR = 'Error';
  21. public const STATUS_INIT_AMOUNT = 'initAmount';
  22. public const STATUS_FREE_PACK = 'freePack';
  23. public const SUBSCRIPTION_LINE_HISTORY_INFORMATION = 'Creación manual';
  24. public const CHANGE_MANUAL_TO_SL = 'Cambio manual a sl ';
  25. public const CHANGE_MANUAL_ID_SL = 'Cambio manual(id sl ';
  26. public const STATUS_NOT_RENEWED_SUBSCRIPTIONS = [
  27. self::STATUS_CANCEL, self::STATUS_ERROR, self::STATUS_INIT_AMOUNT, self::STATUS_INIT_AMOUNT,
  28. ];
  29. /**
  30. * @var int
  31. *
  32. * @ORM\Id
  33. *
  34. * @ORM\GeneratedValue(strategy="AUTO")
  35. *
  36. * @ORM\Column(type="integer", name="id_subscription_lines_history")
  37. */
  38. private $id;
  39. /**
  40. * @var Subscription
  41. *
  42. * @ORM\ManyToOne(targetEntity="App\Entity\System\Subscription", inversedBy="subscriptionLineHistories")
  43. *
  44. * @ORM\JoinColumn(referencedColumnName="id_subscription", name="id_subscription", nullable=false)
  45. */
  46. private $subscription;
  47. /**
  48. * @var SubscriptionLine
  49. *
  50. * @ORM\ManyToOne(targetEntity="SubscriptionLine", inversedBy="subscriptionLineHistories")
  51. *
  52. * @ORM\JoinColumn(name="id_subscription_lines", referencedColumnName="id_subscription_lines", nullable=false)
  53. */
  54. private $subscriptionLine;
  55. /**
  56. * @var string|null
  57. *
  58. * @ORM\Column(type="string", length=100, nullable=true)
  59. */
  60. private $name;
  61. /**
  62. * @var \DateTime
  63. *
  64. * @ORM\Column(type="datetime", options={"default" : "CURRENT_TIMESTAMP"})
  65. */
  66. private $dateCreate;
  67. /**
  68. * @var Customer
  69. *
  70. * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer")
  71. *
  72. * @ORM\JoinColumn(referencedColumnName="id_customer", name="id_customer", nullable=false)
  73. */
  74. private $customer;
  75. /**
  76. * @var bool|null
  77. *
  78. * @ORM\Column(type="boolean", nullable=true, options={"default" : "0"})
  79. */
  80. private $vies;
  81. /**
  82. * @var \DateTime|null
  83. *
  84. * @ORM\Column(type="datetime", nullable=true, options={"default" : "0000-00-00 00:00:00"})
  85. */
  86. private $dateDue;
  87. /**
  88. * @var float|null
  89. *
  90. * @ORM\Column(type="float", nullable=true, options={"default" : "0"})
  91. */
  92. private $cost;
  93. /**
  94. * @var int|null
  95. *
  96. * @ORM\Column(type="integer", nullable=true)
  97. */
  98. private $userCreate;
  99. /**
  100. * @var int|null
  101. *
  102. * @ORM\Column(type="integer", nullable=true)
  103. */
  104. private $userMod;
  105. /**
  106. * @var int|null
  107. *
  108. * @ORM\Column(type="integer", nullable=true)
  109. */
  110. private ?int $nintentos = 0;
  111. /**
  112. * @var string|null
  113. *
  114. * @ORM\Column(name="id_transaction", type="string", length=100, nullable=true)
  115. */
  116. private $transaction;
  117. /**
  118. * @var bool|null
  119. *
  120. * @ORM\Column(type="boolean", options={"default":0}, nullable=true)
  121. */
  122. private $erp;
  123. /**
  124. * @var string|null
  125. *
  126. * @ORM\Column(type="string", length=100, nullable=true)
  127. */
  128. private $idSubscriptionPaypal;
  129. /**
  130. * @var string|null
  131. *
  132. * @ORM\Column(type="text", nullable=true)
  133. */
  134. private $information;
  135. /**
  136. * @var Collection<int, SubscriptionCustomerHistory>
  137. *
  138. * @ORM\OneToMany(targetEntity="App\Entity\System\SubscriptionCustomerHistory", mappedBy="subscriptionLineHistory", cascade={"persist"})
  139. */
  140. private $subscriptionCustomerHistories;
  141. /**
  142. * @ORM\Column(type="boolean", nullable=false, options={"default": 0})
  143. */
  144. private bool $migrated = false;
  145. /**
  146. * @ORM\Column(type="string", length=64, name="internal_migration_status", nullable=true)
  147. */
  148. private ?string $internalMigrationStatus;
  149. public function __construct()
  150. {
  151. $this->subscriptionCustomerHistories = new ArrayCollection();
  152. }
  153. /**
  154. * @return int
  155. */
  156. public function getId(): int
  157. {
  158. return $this->id;
  159. }
  160. /**
  161. * @return Subscription
  162. */
  163. public function getSubscription(): Subscription
  164. {
  165. return $this->subscription;
  166. }
  167. /**
  168. * @param Subscription $subscription
  169. *
  170. * @return SubscriptionLineHistory
  171. */
  172. public function setSubscription(Subscription $subscription): SubscriptionLineHistory
  173. {
  174. $this->subscription = $subscription;
  175. return $this;
  176. }
  177. /**
  178. * @return SubscriptionLine
  179. */
  180. public function getSubscriptionLine(): SubscriptionLine
  181. {
  182. return $this->subscriptionLine;
  183. }
  184. /**
  185. * @param SubscriptionLine $subscriptionLine
  186. *
  187. * @return SubscriptionLineHistory
  188. */
  189. public function setSubscriptionLine(SubscriptionLine $subscriptionLine): SubscriptionLineHistory
  190. {
  191. $this->subscriptionLine = $subscriptionLine;
  192. return $this;
  193. }
  194. /**
  195. * @return string|null
  196. */
  197. public function getName(): ?string
  198. {
  199. return $this->name;
  200. }
  201. /**
  202. * @param string|null $name
  203. *
  204. * @return SubscriptionLineHistory
  205. */
  206. public function setName(?string $name): SubscriptionLineHistory
  207. {
  208. $this->name = $name;
  209. return $this;
  210. }
  211. /**
  212. * @return \DateTime
  213. */
  214. public function getDateCreate(): \DateTime
  215. {
  216. return $this->dateCreate;
  217. }
  218. /**
  219. * @param \DateTime $dateCreate
  220. *
  221. * @return SubscriptionLineHistory
  222. */
  223. public function setDateCreate(\DateTime $dateCreate): SubscriptionLineHistory
  224. {
  225. $this->dateCreate = $dateCreate;
  226. return $this;
  227. }
  228. /**
  229. * @return Customer|null
  230. */
  231. public function getCustomer(): ?Customer
  232. {
  233. return $this->customer;
  234. }
  235. /**
  236. * @param Customer|null $customer
  237. *
  238. * @return SubscriptionLineHistory
  239. */
  240. public function setCustomer(?Customer $customer): SubscriptionLineHistory
  241. {
  242. $this->customer = $customer;
  243. return $this;
  244. }
  245. /**
  246. * @return bool|null
  247. */
  248. public function getVies(): ?bool
  249. {
  250. return $this->vies;
  251. }
  252. /**
  253. * @param bool|null $vies
  254. *
  255. * @return SubscriptionLineHistory
  256. */
  257. public function setVies(?bool $vies): SubscriptionLineHistory
  258. {
  259. $this->vies = $vies;
  260. return $this;
  261. }
  262. /**
  263. * @return \DateTime
  264. */
  265. public function getDateDue(): ?\DateTime
  266. {
  267. return $this->dateDue;
  268. }
  269. /**
  270. * @param \DateTime|null $dateDue
  271. *
  272. * @return SubscriptionLineHistory
  273. */
  274. public function setDateDue(?\DateTime $dateDue): SubscriptionLineHistory
  275. {
  276. $this->dateDue = $dateDue;
  277. return $this;
  278. }
  279. /**
  280. * @return float|null
  281. */
  282. public function getCost(): ?float
  283. {
  284. return $this->cost;
  285. }
  286. /**
  287. * @param float|null $cost
  288. *
  289. * @return SubscriptionLineHistory
  290. */
  291. public function setCost(?float $cost): SubscriptionLineHistory
  292. {
  293. $this->cost = $cost;
  294. return $this;
  295. }
  296. /**
  297. * @return int|null
  298. */
  299. public function getUserCreate(): ?int
  300. {
  301. return $this->userCreate;
  302. }
  303. /**
  304. * @param int|null $userCreate
  305. *
  306. * @return SubscriptionLineHistory
  307. */
  308. public function setUserCreate(?int $userCreate): SubscriptionLineHistory
  309. {
  310. $this->userCreate = $userCreate;
  311. return $this;
  312. }
  313. /**
  314. * @return int|null
  315. */
  316. public function getUserMod(): ?int
  317. {
  318. return $this->userMod;
  319. }
  320. /**
  321. * @param int|null $userMod
  322. *
  323. * @return SubscriptionLineHistory
  324. */
  325. public function setUserMod(?int $userMod): SubscriptionLineHistory
  326. {
  327. $this->userMod = $userMod;
  328. return $this;
  329. }
  330. public function getNintentos(): ?int
  331. {
  332. return $this->nintentos;
  333. }
  334. /**
  335. * @param int|null $nintentos
  336. *
  337. * @return SubscriptionLineHistory
  338. */
  339. public function setNintentos(?int $nintentos): SubscriptionLineHistory
  340. {
  341. $this->nintentos = $nintentos;
  342. return $this;
  343. }
  344. /**
  345. * @return string|null
  346. */
  347. public function getTransaction(): ?string
  348. {
  349. return $this->transaction;
  350. }
  351. /**
  352. * @param string|null $transaction
  353. *
  354. * @return SubscriptionLineHistory
  355. */
  356. public function setTransaction(?string $transaction): SubscriptionLineHistory
  357. {
  358. $this->transaction = $transaction;
  359. return $this;
  360. }
  361. /**
  362. * @return bool|null
  363. */
  364. public function getErp(): ?bool
  365. {
  366. return $this->erp;
  367. }
  368. /**
  369. * @param bool|null $erp
  370. *
  371. * @return SubscriptionLineHistory
  372. */
  373. public function setErp(?bool $erp): SubscriptionLineHistory
  374. {
  375. $this->erp = $erp;
  376. return $this;
  377. }
  378. /**
  379. * @return string|null
  380. */
  381. public function getIdSubscriptionPaypal(): ?string
  382. {
  383. return $this->idSubscriptionPaypal;
  384. }
  385. /**
  386. * @param string|null $idSubscriptionPaypal
  387. *
  388. * @return SubscriptionLineHistory
  389. */
  390. public function setIdSubscriptionPaypal(?string $idSubscriptionPaypal): SubscriptionLineHistory
  391. {
  392. $this->idSubscriptionPaypal = $idSubscriptionPaypal;
  393. return $this;
  394. }
  395. /**
  396. * @return string|null
  397. */
  398. public function getInformation(): ?string
  399. {
  400. return $this->information;
  401. }
  402. /**
  403. * @param string|null $information
  404. *
  405. * @return SubscriptionLineHistory
  406. */
  407. public function setInformation(?string $information): SubscriptionLineHistory
  408. {
  409. $this->information = $information;
  410. return $this;
  411. }
  412. /**
  413. * @return Collection<int, SubscriptionCustomerHistory>
  414. */
  415. public function getSubscriptionCustomerHistories()
  416. {
  417. return $this->subscriptionCustomerHistories;
  418. }
  419. public function isMigrated(): bool
  420. {
  421. return $this->migrated;
  422. }
  423. public function setMigrated(bool $migrated): SubscriptionLineHistory
  424. {
  425. $this->migrated = $migrated;
  426. return $this;
  427. }
  428. public function getInternalMigrationStatus(): ?string
  429. {
  430. return $this->internalMigrationStatus;
  431. }
  432. public function setInternalMigrationStatus(?string $internalMigrationStatus): SubscriptionLineHistory
  433. {
  434. $this->internalMigrationStatus = $internalMigrationStatus;
  435. return $this;
  436. }
  437. public function setLineToMigrated(): SubscriptionLineHistory
  438. {
  439. $this->migrated = true;
  440. $this->internalMigrationStatus = 'migrated';
  441. return $this;
  442. }
  443. }