src/Entity/Invoice.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoiceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=InvoiceRepository::class)
  9.  */
  10. class Invoice
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Orders::class, inversedBy="invoices")
  20.      */
  21.     private $orderNumber;
  22.     /**
  23.      * @ORM\Column(type="boolean")
  24.      */
  25.     private $deleted false;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $idPunch null;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=Establishments::class, inversedBy="invoices")
  32.      */
  33.     private $establishment null;
  34.     /**
  35.      * @ORM\Column(type="boolean")
  36.      */
  37.     private $paid;
  38.     /**
  39.      * @ORM\Column(type="date", nullable=true)
  40.      */
  41.     private $time_paid;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $pdfName;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity=EmailInvoice::class, mappedBy="invoice")
  48.      */
  49.     private $emailInvoices;
  50.     /**
  51.      * @ORM\Column(type="datetime", nullable=true)
  52.      */
  53.     private $updatedAt;
  54.     public function __construct()
  55.     {
  56.         $this->emailInvoices = new ArrayCollection();
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getOrderNumber(): ?Orders
  63.     {
  64.         return $this->orderNumber;
  65.     }
  66.     public function setOrderNumber(?Orders $orderNumber): self
  67.     {
  68.         $this->orderNumber $orderNumber;
  69.         return $this;
  70.     }
  71.     public function getIdPunch(): ?string
  72.     {
  73.         return $this->idPunch;
  74.     }
  75.     public function setIdPunch(?string $idPunch): self
  76.     {
  77.         $this->idPunch $idPunch;
  78.         return $this;
  79.     }
  80.     public function isDeleted(): ?bool
  81.     {
  82.         return $this->deleted;
  83.     }
  84.     public function setDeleted(bool $deleted): self
  85.     {
  86.         $this->deleted $deleted;
  87.         return $this;
  88.     }
  89.     public function getEstablishment(): ?Establishments
  90.     {
  91.         return $this->establishment;
  92.     }
  93.     public function setEstablishment(?Establishments $establishment): self
  94.     {
  95.         $this->establishment $establishment;
  96.         return $this;
  97.     }
  98.     public function isPaid(): ?bool
  99.     {
  100.         return $this->paid;
  101.     }
  102.     public function setPaid(bool $paid): self
  103.     {
  104.         $this->paid $paid;
  105.         return $this;
  106.     }
  107.     public function getTimePaid(): ?\DateTimeInterface
  108.     {
  109.         return $this->time_paid;
  110.     }
  111.     public function setTimePaid(?\DateTimeInterface $time_paid): self
  112.     {
  113.         $this->time_paid $time_paid;
  114.         return $this;
  115.     }
  116.     public function getPdfName(): ?string
  117.     {
  118.         return $this->pdfName;
  119.     }
  120.     public function setPdfName(?string $pdfName): self
  121.     {
  122.         $this->pdfName $pdfName;
  123.         return $this;
  124.     }
  125.     /**
  126.      * @return Collection<int, EmailInvoice>
  127.      */
  128.     public function getEmailInvoices(): Collection
  129.     {
  130.         return $this->emailInvoices;
  131.     }
  132.     public function addEmailInvoice(EmailInvoice $emailInvoice): self
  133.     {
  134.         if (!$this->emailInvoices->contains($emailInvoice)) {
  135.             $this->emailInvoices[] = $emailInvoice;
  136.             $emailInvoice->setInvoice($this);
  137.         }
  138.         return $this;
  139.     }
  140.     public function removeEmailInvoice(EmailInvoice $emailInvoice): self
  141.     {
  142.         if ($this->emailInvoices->removeElement($emailInvoice)) {
  143.             // set the owning side to null (unless already changed)
  144.             if ($emailInvoice->getInvoice() === $this) {
  145.                 $emailInvoice->setInvoice(null);
  146.             }
  147.         }
  148.         return $this;
  149.     }
  150.     public function getUpdatedAt(): ?\DateTimeInterface
  151.     {
  152.         return $this->updatedAt;
  153.     }
  154.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  155.     {
  156.         $this->updatedAt $updatedAt;
  157.         return $this;
  158.     }
  159. }