src/Entity/Payment.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaymentRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassPaymentRepository::class)]
  7. #[ORM\HasLifecycleCallbacks]
  8. class Payment
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $paymentId null;
  14.     #[ORM\ManyToOne(inversedBy'payments'fetch:"EAGER")]
  15.     #[ORM\JoinColumn(name:"payment_type_code"referencedColumnName"payment_type_code"nullablefalse)]
  16.     private ?PaymentType $paymentType null;
  17.     #[ORM\ManyToOne(inversedBy'payments'fetch:"EAGER")]
  18.     #[ORM\JoinColumn(name:"payment_status_code"referencedColumnName"payment_status_code"nullablefalse)]
  19.     private ?PaymentStatus $paymentStatus null;
  20.     #[ORM\ManyToOne(inversedBy'payments')]
  21.     #[ORM\JoinColumn(name:"user_id"referencedColumnName"id"nullabletrue)]
  22.     private ?User $user null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $email null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $paymentIntentId null;
  27.     #[ORM\Column]
  28.     private ?int $amount null;
  29.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  30.     private ?\DateTimeInterface $updated null;
  31.     #[ORM\Column]
  32.     private ?int $updatedBy null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  34.     private ?\DateTimeInterface $created null;
  35.     public function getPaymentId(): ?int
  36.     {
  37.         return $this->paymentId;
  38.     }
  39.     public function setPaymentId(int $paymentId): static
  40.     {
  41.         $this->paymentId $paymentId;
  42.         return $this;
  43.     }
  44.     public function getPaymentType(): ?PaymentType
  45.     {
  46.         return $this->paymentType;
  47.     }
  48.     public function setPaymentType(?PaymentType $paymentType): static
  49.     {
  50.         $this->paymentType $paymentType;
  51.         return $this;
  52.     }
  53.     public function getPaymentStatus(): ?PaymentStatus
  54.     {
  55.         return $this->paymentStatus;
  56.     }
  57.     public function setPaymentStatus(?PaymentStatus $paymentStatus): static
  58.     {
  59.         $this->paymentStatus $paymentStatus;
  60.         return $this;
  61.     }
  62.     public function getUser(): ?User
  63.     {
  64.         return $this->user;
  65.     }
  66.     public function setUser(?User $user): static
  67.     {
  68.         $this->user $user;
  69.         return $this;
  70.     }
  71.     public function getEmail(): ?string
  72.     {
  73.         return $this->email;
  74.     }
  75.     public function setEmail(?string $email): static
  76.     {
  77.         $this->email $email;
  78.         return $this;
  79.     }
  80.     public function getPaymentIntentId(): ?string
  81.     {
  82.         return $this->paymentIntentId;
  83.     }
  84.     public function setPaymentIntentId(?string $paymentIntentId): static
  85.     {
  86.         $this->paymentIntentId $paymentIntentId;
  87.         return $this;
  88.     }
  89.     public function getAmount(): ?int
  90.     {
  91.         return $this->amount;
  92.     }
  93.     public function setAmount(int $amount): static
  94.     {
  95.         $this->amount $amount;
  96.         return $this;
  97.     }
  98.     public function getUpdated(): ?\DateTimeInterface
  99.     {
  100.         return $this->updated;
  101.     }
  102.     #[ORM\PrePersist]
  103.     #[ORM\PreUpdate]
  104.     public function setUpdatedTimestamp(): void
  105.     {
  106.         $this->updated = new \DateTime();
  107.     }
  108. //    public function setUpdated(\DateTimeInterface $updated): static
  109. //    {
  110. //        $this->updated = $updated;
  111. //
  112. //        return $this;
  113. //    }
  114.     public function getUpdatedBy(): ?int
  115.     {
  116.         return $this->updatedBy;
  117.     }
  118.     public function setUpdatedBy(int $updatedBy): static
  119.     {
  120.         $this->updatedBy $updatedBy;
  121.         return $this;
  122.     }
  123.     public function getCreated(): ?\DateTimeInterface
  124.     {
  125.         return $this->created;
  126.     }
  127.     #[ORM\PrePersist]
  128.     #[ORM\PreUpdate]
  129.     public function setCreatedTimestamp(): void
  130.     {
  131.         $this->created = new \DateTime();
  132.     }
  133.     public function setCreated(\DateTimeInterface $created): static
  134.     {
  135.         $this->created $created;
  136.         return $this;
  137.     }
  138. }