src/Entity/Channel/Payment/LicensesInvoice.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Channel\Payment;
  3. use App\Entity\Channel\Channel;
  4. use App\Enum\Pennylane\InvoiceStatusEnum;
  5. use App\Repository\Channel\Payment\LicensesInvoiceRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[
  9. ORM\Entity(repositoryClass: LicensesInvoiceRepository::class),
  10. ORM\Table(name: 'channel_licenses_invoice'),
  11. ]
  12. class LicensesInvoice
  13. {
  14. #[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
  15. private ?int $id = null;
  16. #[ORM\ManyToOne(targetEntity: Channel::class)]
  17. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  18. private ?Channel $channel = null;
  19. #[ORM\Column(type: 'string', nullable: false)]
  20. private ?string $invoiceNumber = null;
  21. #[ORM\Column(type: 'date_immutable', nullable: false)]
  22. private ?\DateTimeImmutable $deadlineAt = null;
  23. #[ORM\Column(type: 'string', nullable: false)]
  24. private ?string $amount = null;
  25. #[ORM\Column(type: 'string', nullable: false)]
  26. private ?string $pennylaneId = null;
  27. #[ORM\Column(type: 'datetime_immutable', nullable: false)]
  28. private ?\DateTimeImmutable $pennylaneCreatedAt = null;
  29. #[ORM\Column(type: 'datetime_immutable', nullable: false)]
  30. private ?\DateTimeImmutable $pennylaneUpdateAt = null;
  31. #[ORM\Column(type: 'string', nullable: false, options: ['default' => InvoiceStatusEnum::UPCOMING])]
  32. #[Assert\Choice(callback: [InvoiceStatusEnum::class, 'getChoices'])]
  33. private string $pennylanePaymentStatus = InvoiceStatusEnum::UPCOMING;
  34. public function getId(): ?int
  35. {
  36. return $this->id;
  37. }
  38. public function getChannel(): ?Channel
  39. {
  40. return $this->channel;
  41. }
  42. public function setChannel(?Channel $channel): LicensesInvoice
  43. {
  44. $this->channel = $channel;
  45. return $this;
  46. }
  47. public function getInvoiceNumber(): ?string
  48. {
  49. return $this->invoiceNumber;
  50. }
  51. public function setInvoiceNumber(?string $invoiceNumber): LicensesInvoice
  52. {
  53. $this->invoiceNumber = $invoiceNumber;
  54. return $this;
  55. }
  56. public function getDeadlineAt(): ?\DateTimeImmutable
  57. {
  58. return $this->deadlineAt;
  59. }
  60. public function setDeadlineAt(?\DateTimeImmutable $deadlineAt): LicensesInvoice
  61. {
  62. $this->deadlineAt = $deadlineAt;
  63. return $this;
  64. }
  65. public function getAmount(): ?string
  66. {
  67. return $this->amount;
  68. }
  69. public function setAmount(?string $amount): LicensesInvoice
  70. {
  71. $this->amount = $amount;
  72. return $this;
  73. }
  74. public function getPennylaneId(): ?string
  75. {
  76. return $this->pennylaneId;
  77. }
  78. public function setPennylaneId(?string $pennylaneId): LicensesInvoice
  79. {
  80. $this->pennylaneId = $pennylaneId;
  81. return $this;
  82. }
  83. public function getPennylaneCreatedAt(): ?\DateTimeImmutable
  84. {
  85. return $this->pennylaneCreatedAt;
  86. }
  87. public function setPennylaneCreatedAt(?\DateTimeImmutable $pennylaneCreatedAt): LicensesInvoice
  88. {
  89. $this->pennylaneCreatedAt = $pennylaneCreatedAt;
  90. return $this;
  91. }
  92. public function getPennylaneUpdateAt(): ?\DateTimeImmutable
  93. {
  94. return $this->pennylaneUpdateAt;
  95. }
  96. public function setPennylaneUpdateAt(?\DateTimeImmutable $pennylaneUpdateAt): LicensesInvoice
  97. {
  98. $this->pennylaneUpdateAt = $pennylaneUpdateAt;
  99. return $this;
  100. }
  101. public function getPennylanePaymentStatus(): string
  102. {
  103. return $this->pennylanePaymentStatus;
  104. }
  105. public function setPennylanePaymentStatus(string $pennylanePaymentStatus): LicensesInvoice
  106. {
  107. $this->pennylanePaymentStatus = $pennylanePaymentStatus;
  108. return $this;
  109. }
  110. }