<?php
namespace App\Entity;
use App\Repository\InvoiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=InvoiceRepository::class)
*/
class Invoice
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Orders::class, inversedBy="invoices")
*/
private $orderNumber;
/**
* @ORM\Column(type="boolean")
*/
private $deleted = false;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $idPunch = null;
/**
* @ORM\ManyToOne(targetEntity=Establishments::class, inversedBy="invoices")
*/
private $establishment = null;
/**
* @ORM\Column(type="boolean")
*/
private $paid;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $time_paid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pdfName;
/**
* @ORM\OneToMany(targetEntity=EmailInvoice::class, mappedBy="invoice")
*/
private $emailInvoices;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
public function __construct()
{
$this->emailInvoices = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getOrderNumber(): ?Orders
{
return $this->orderNumber;
}
public function setOrderNumber(?Orders $orderNumber): self
{
$this->orderNumber = $orderNumber;
return $this;
}
public function getIdPunch(): ?string
{
return $this->idPunch;
}
public function setIdPunch(?string $idPunch): self
{
$this->idPunch = $idPunch;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function getEstablishment(): ?Establishments
{
return $this->establishment;
}
public function setEstablishment(?Establishments $establishment): self
{
$this->establishment = $establishment;
return $this;
}
public function isPaid(): ?bool
{
return $this->paid;
}
public function setPaid(bool $paid): self
{
$this->paid = $paid;
return $this;
}
public function getTimePaid(): ?\DateTimeInterface
{
return $this->time_paid;
}
public function setTimePaid(?\DateTimeInterface $time_paid): self
{
$this->time_paid = $time_paid;
return $this;
}
public function getPdfName(): ?string
{
return $this->pdfName;
}
public function setPdfName(?string $pdfName): self
{
$this->pdfName = $pdfName;
return $this;
}
/**
* @return Collection<int, EmailInvoice>
*/
public function getEmailInvoices(): Collection
{
return $this->emailInvoices;
}
public function addEmailInvoice(EmailInvoice $emailInvoice): self
{
if (!$this->emailInvoices->contains($emailInvoice)) {
$this->emailInvoices[] = $emailInvoice;
$emailInvoice->setInvoice($this);
}
return $this;
}
public function removeEmailInvoice(EmailInvoice $emailInvoice): self
{
if ($this->emailInvoices->removeElement($emailInvoice)) {
// set the owning side to null (unless already changed)
if ($emailInvoice->getInvoice() === $this) {
$emailInvoice->setInvoice(null);
}
}
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
}