<?php
namespace App\Entity;
use App\Repository\InvoiceRepository;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
use DateTimeZone;
/**
* @ORM\Entity(repositoryClass=InvoiceRepository::class)
*/
class Invoice
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, unique=true, nullable=true)
*/
private $invoiceNumber;
/**
* @ORM\Column(type="string", length=255)
*/
private $status;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\OneToOne(targetEntity=CreditTransaction::class, inversedBy="invoice")
* @ORM\JoinColumn(nullable=false)
*/
private $creditTransaction;
public function __construct()
{
$timezone = new DateTimeZone('Europe/Paris');
$this->createdAt = new DateTime('now', $timezone);
}
public function getId(): ?int
{
return $this->id;
}
public function getInvoiceNumber(): ?string
{
return $this->invoiceNumber;
}
public function setInvoiceNumber(?string $invoiceNumber): self
{
$this->invoiceNumber = $invoiceNumber;
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 getCreditTransaction(): ?CreditTransaction
{
return $this->creditTransaction;
}
public function setCreditTransaction(?CreditTransaction $creditTransaction): self
{
$this->creditTransaction = $creditTransaction;
return $this;
}
}