src/Entity/Payments.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaymentsRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassPaymentsRepository::class)]
  7. class Payments
  8. {
  9.     const STATUS_PENDING 'pending';
  10.     const STATUS_PAID 'paid';
  11.     const STATUS_FAILED 'failed';
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(nullabletrue)]
  17.     private ?int $user_id null;
  18.     #[ORM\Column(length20)]
  19.     private ?string $currency null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $charge_id null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $payment_channel null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $description null;
  26.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  27.     private ?Subscription $subscription null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $status self::STATUS_PENDING;
  30.     #[ORM\Column(nullabletrue)]
  31.     private ?float $amount null;
  32.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  33.     private ?\DateTimeInterface $createdAt null;
  34.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  35.     private ?\DateTimeInterface $updatedAt null;
  36.     public function __construct()
  37.     {
  38.         $this->updatedAt = new \DateTimeImmutable('now');
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getUserId(): ?int
  45.     {
  46.         return $this->user_id;
  47.     }
  48.     public function setUserId(?int $user_id): self
  49.     {
  50.         $this->user_id $user_id;
  51.         return $this;
  52.     }
  53.     public function getCurrency(): ?string
  54.     {
  55.         return $this->currency;
  56.     }
  57.     public function setCurrency(string $currency): self
  58.     {
  59.         $this->currency $currency;
  60.         return $this;
  61.     }
  62.     public function getChargeId(): ?string
  63.     {
  64.         return $this->charge_id;
  65.     }
  66.     public function setChargeId(string $charge_id): self
  67.     {
  68.         $this->charge_id $charge_id;
  69.         return $this;
  70.     }
  71.     public function getPaymentChannel(): ?string
  72.     {
  73.         return $this->payment_channel;
  74.     }
  75.     public function setPaymentChannel(string $payment_channel): self
  76.     {
  77.         $this->payment_channel $payment_channel;
  78.         return $this;
  79.     }
  80.     public function getDescription(): ?string
  81.     {
  82.         return $this->description;
  83.     }
  84.     public function setDescription(?string $description): self
  85.     {
  86.         $this->description $description;
  87.         return $this;
  88.     }
  89.     public function getSubscription(): ?Subscription
  90.     {
  91.         return $this->subscription;
  92.     }
  93.     public function setSubscription(?Subscription $subscription): self
  94.     {
  95.         $this->subscription $subscription;
  96.         return $this;
  97.     }
  98.     public function getStatus(): ?string
  99.     {
  100.         return $this->status;
  101.     }
  102.     public function setStatus(string $status): self
  103.     {
  104.         $this->status $status;
  105.         return $this;
  106.     }
  107.     public function getAmount(): ?float
  108.     {
  109.         return $this->amount;
  110.     }
  111.     public function setAmount(?float $amount): self
  112.     {
  113.         $this->amount $amount;
  114.         return $this;
  115.     }
  116.     public function getCreatedAt(): ?\DateTimeInterface
  117.     {
  118.         return $this->createdAt;
  119.     }
  120.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  121.     {
  122.         $this->createdAt $createdAt;
  123.         return $this;
  124.     }
  125.     public function getUpdatedAt(): ?\DateTimeInterface
  126.     {
  127.         return $this->updatedAt;
  128.     }
  129.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  130.     {
  131.         $this->updatedAt $updatedAt;
  132.         return $this;
  133.     }
  134. }