src/Entity/Payment.php line 16

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. /**
  9. * Payment
  10. *
  11. * @ORM\Table(name="payment")
  12. * @ORM\Entity(repositoryClass=PaymentRepository::class)
  13. */
  14. class Payment
  15. {
  16. use TimeStampable;
  17. use Amount;
  18. public const NUM_ITEMS_PER_PAGE = 20;
  19. /**
  20. * @var int
  21. *
  22. * @ORM\Column(name="id", type="integer")
  23. * @ORM\Id
  24. * @ORM\GeneratedValue(strategy="AUTO")
  25. */
  26. private $id;
  27. /**
  28. * @ORM\Column(type="string", length=50, nullable=true, unique=true)
  29. */
  30. private $code;
  31. /**
  32. * @ORM\ManyToOne(targetEntity=Subscription::class)
  33. * @ORM\JoinColumn(name="subscription_id", referencedColumnName="id", nullable=true)
  34. */
  35. private $subscription;
  36. public function __construct()
  37. {
  38. $this->createdAt= new \DateTime();
  39. $this->updatedAt= new \DateTime();
  40. }
  41. /**
  42. * Get id
  43. *
  44. * @return int
  45. */
  46. public function getId()
  47. {
  48. return $this->id;
  49. }
  50. public function getCode(): ?string
  51. {
  52. return $this->code;
  53. }
  54. public function setCode(string $code): self
  55. {
  56. $this->code = $code;
  57. return $this;
  58. }
  59. public function getSubscription(): ?Subscription
  60. {
  61. return $this->subscription;
  62. }
  63. public function setSubscription(?Subscription $subscription): static
  64. {
  65. $this->subscription = $subscription;
  66. return $this;
  67. }
  68. }