<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'payment')]
#[ORM\Entity(repositoryClass: 'App\Entity\Repository\PaymentRepository')]
class Payment
{
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
#[ORM\Column(type: 'string', nullable: true)]
private $type;
#[ORM\Column(type: 'string', nullable: true)]
private $subscription_type;
#[ORM\Column(type: 'json', nullable: true)]
private $transaction_data;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_payment;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_created;
#[ORM\Column(type: 'decimal', nullable: true, precision: 6, scale: 2)]
private $value;
#[ORM\Column(type: 'string', nullable: true)]
private $status;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User', inversedBy: 'payment')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false)]
private $user;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Invoice', inversedBy: 'payment')]
#[ORM\JoinColumn(name: 'invoice_id', referencedColumnName: 'id')]
private $invoice;
#[ORM\Column(length: 50, nullable: true)]
private ?string $provider = null;
#[ORM\Column(length: 5, nullable: true)]
private ?string $currency = null;
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getTransactionData()
{
return $this->transaction_data;
}
public function setTransactionData($transaction_data): self
{
$this->transaction_data = $transaction_data;
return $this;
}
public function getDatePayment(): ?\DateTimeInterface
{
return $this->date_payment;
}
public function setDatePayment(?\DateTimeInterface $date_payment): self
{
$this->date_payment = $date_payment;
return $this;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->date_created;
}
public function setDateCreated(?\DateTimeInterface $date_created): self
{
$this->date_created = $date_created;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getInvoice(): ?Invoice
{
return $this->invoice;
}
public function setInvoice(?Invoice $invoice): self
{
$this->invoice = $invoice;
return $this;
}
public function getValue()
{
return $this->value;
}
public function setValue($value): self
{
$this->value = $value;
return $this;
}
public function getSubscriptionType(): ?string
{
return $this->subscription_type;
}
public function setSubscriptionType(?string $subscription_type): self
{
$this->subscription_type = $subscription_type;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getProvider(): ?string
{
return $this->provider;
}
public function setProvider(?string $provider): static
{
$this->provider = $provider;
return $this;
}
public function getCurrency(): ?string
{
return $this->currency;
}
public function setCurrency(?string $currency): static
{
$this->currency = $currency;
return $this;
}
}