<?php
namespace App\Entity;
use App\Repository\PaymentRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PaymentRepository::class)
*/
class Payment
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="string", length=255)
*/
private $transactionID;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="payments")
* @ORM\JoinColumn(nullable=false)
*/
private $customer;
/**
* @ORM\ManyToOne(targetEntity=BPModel::class)
* @ORM\JoinColumn(nullable=true)
*/
private $bpModel;
/**
* @ORM\ManyToOne(targetEntity=Subscription::class, inversedBy="payments")
* @ORM\JoinColumn(nullable=false)
*/
private $subscription;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $state;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $infos = [];
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=Status::class, inversedBy="payments")
*/
private $status;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable();
}
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 getTransactionID(): ?string
{
return $this->transactionID;
}
public function setTransactionID(string $transactionID): self
{
$this->transactionID = $transactionID;
return $this;
}
public function getCustomer(): ?User
{
return $this->customer;
}
public function setCustomer(?User $customer): self
{
$this->customer = $customer;
return $this;
}
public function getBpModel(): ?BPModel
{
return $this->bpModel;
}
public function setBpModel(?BPModel $bpModel): self
{
$this->bpModel = $bpModel;
return $this;
}
public function getSubscription(): ?Subscription
{
return $this->subscription;
}
public function setSubscription(?Subscription $subscription): self
{
$this->subscription = $subscription;
return $this;
}
public function getState(): ?bool
{
return $this->state;
}
public function setState(?bool $state): self
{
$this->state = $state;
return $this;
}
public function getInfos(): ?array
{
return $this->infos;
}
public function setInfos(?array $infos): self
{
$this->infos = $infos;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getStatus(): ?Status
{
return $this->status;
}
public function setStatus(?Status $status): self
{
$this->status = $status;
return $this;
}
}