src/Flexy/ShopBundle/Entity/Payment/Payment.php line 12
<?php
namespace App\Flexy\ShopBundle\Entity\Payment;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Flexy\ShopBundle\Entity\Order\Order;
use App\Flexy\ShopBundle\Repository\Payment\PaymentRepository;
use Doctrine\ORM\Mapping as ORM;
#[ApiResource]
#[ORM\Entity(repositoryClass: PaymentRepository::class)]
class Payment
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column(type: 'float')]
private ?float $amount = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $state = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description = null;
#[ORM\ManyToOne(targetEntity: PaymentMethod::class, inversedBy: 'payments')]
#[ORM\JoinColumn(nullable: false)]
private ?\App\Flexy\ShopBundle\Entity\Payment\PaymentMethod $paymentMethod = null;
#[ORM\ManyToOne(inversedBy: 'payments')]
private ?Order $relatedOrder = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $payerFirstName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $payerLastName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $bankName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $bankAccountNumber = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $reference = null;
public function __toString()
{
return $this->amount ." (".$this->paymentMethod.")";
}
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(string $state): self
{
$this->state = $state;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getPaymentMethod(): ?PaymentMethod
{
return $this->paymentMethod;
}
public function setPaymentMethod(?PaymentMethod $paymentMethod): self
{
$this->paymentMethod = $paymentMethod;
return $this;
}
public function getRelatedOrder(): ?Order
{
return $this->relatedOrder;
}
public function setRelatedOrder(?Order $relatedOrder): self
{
$this->relatedOrder = $relatedOrder;
return $this;
}
public function getPayerFirstName(): ?string
{
return $this->payerFirstName;
}
public function setPayerFirstName(?string $payerFirstName): self
{
$this->payerFirstName = $payerFirstName;
return $this;
}
public function getPayerLastName(): ?string
{
return $this->payerLastName;
}
public function setPayerLastName(?string $payerLastName): self
{
$this->payerLastName = $payerLastName;
return $this;
}
public function getBankName(): ?string
{
return $this->bankName;
}
public function setBankName(?string $bankName): self
{
$this->bankName = $bankName;
return $this;
}
public function getBankAccountNumber(): ?string
{
return $this->bankAccountNumber;
}
public function setBankAccountNumber(?string $bankAccountNumber): self
{
$this->bankAccountNumber = $bankAccountNumber;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
}