<?php
namespace App\Entity;
use App\Repository\PaymentDetailsRepository;
use App\String\Constant;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PaymentDetailsRepository::class)]
class PaymentDetails
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'float', nullable: true)]
private $amount;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $status;
#[ORM\Column(type: 'datetime', nullable: true)]
private $createdAt;
#[ORM\Column(type: 'datetime', nullable: true)]
private $modifiedAt;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $type;
#[ORM\OneToOne(inversedBy: 'paymentDetails', targetEntity: OrderDetails::class, cascade: ['persist', 'remove'])]
private $orderDetails;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isPaid;
public function getId(): ?int
{
return $this->id;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(?float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modifiedAt;
}
public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
{
$this->modifiedAt = $modifiedAt;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getOrderDetails(): ?OrderDetails
{
return $this->orderDetails;
}
public function setOrderDetails(?OrderDetails $orderDetails): self
{
$this->orderDetails = $orderDetails;
return $this;
}
public function isIsPaid(): ?bool
{
return $this->isPaid;
}
public function setIsPaid(?bool $isPaid): self
{
$this->isPaid = $isPaid;
return $this;
}
public function setPaid(): self
{
$this->status = Constant::PAYMENT_STATUS_PAID;
$this->isPaid = true;
return $this;
}
public function setRefundedStatus(): self
{
$this->status = Constant::PAYMENT_STATUS_REFUNDED;
return $this;
}
public function setPendingStatus(): self
{
$this->status = Constant::PAYMENT_STATUS_PENDING;
return $this;
}
public function setFailedStatus(): self
{
$this->status = Constant::PAYMENT_STATUS_FAILED;
return $this;
}
public function setEftType(): self
{
$this->type = Constant::PAYMENT_EFT;
return $this;
}
}