src/Entity/Payment.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Subscription;
  4. use App\Repository\PaymentRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Traits\TimeStampable;
  7. use App\Entity\Traits\Amount;
  8. use App\Entity\Student;
  9. /**
  10. * Payment
  11. *
  12. * @ORM\Table(name="payment")
  13. * @ORM\Entity(repositoryClass=PaymentRepository::class)
  14. */
  15. class Payment
  16. {
  17. use TimeStampable;
  18. use Amount;
  19. public const NUM_ITEMS_PER_PAGE = 20;
  20. /**
  21. * @var int
  22. *
  23. * @ORM\Column(name="id", type="integer")
  24. * @ORM\Id
  25. * @ORM\GeneratedValue(strategy="AUTO")
  26. */
  27. private $id;
  28. /**
  29. * @ORM\Column(type="string", length=50, nullable=true, unique=true)
  30. */
  31. private $code;
  32. /**
  33. * @ORM\ManyToOne(targetEntity=Subscription::class)
  34. * @ORM\JoinColumn(name="subscription_id", referencedColumnName="id", nullable=true)
  35. */
  36. private $subscription;
  37. /**
  38. * @ORM\ManyToOne(targetEntity=Student::class, inversedBy="payments")
  39. * @ORM\JoinColumn(name="student_id", referencedColumnName="id", nullable=true)
  40. */
  41. private $student;
  42. public function __construct()
  43. {
  44. $this->createdAt = new \DateTime();
  45. $this->updatedAt = new \DateTime();
  46. }
  47. /**
  48. * Get id
  49. *
  50. * @return int
  51. */
  52. public function getId()
  53. {
  54. return $this->id;
  55. }
  56. public function getCode(): ?string
  57. {
  58. return $this->code;
  59. }
  60. public function setCode(string $code): self
  61. {
  62. $this->code = $code;
  63. return $this;
  64. }
  65. public function getSubscription(): ?Subscription
  66. {
  67. return $this->subscription;
  68. }
  69. public function setSubscription(?Subscription $subscription): static
  70. {
  71. $this->subscription = $subscription;
  72. return $this;
  73. }
  74. public function getStudent(): ?Student
  75. {
  76. return $this->student;
  77. }
  78. public function setStudent(?Student $student): self
  79. {
  80. $this->student = $student;
  81. return $this;
  82. }
  83. }