src/Entity/Invoice.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Table(name'invoice')]
  7. #[ORM\Entity(repositoryClass'App\Entity\Repository\InvoiceRepository')]
  8. class Invoice
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(type'integer')]
  12.     #[ORM\GeneratedValue(strategy'AUTO')]
  13.     private $id;
  14.     #[ORM\Column(type'json'nullabletrue)]
  15.     private $positions;
  16.     #[ORM\Column(type'json'nullabletrue)]
  17.     private $address;
  18.     #[ORM\Column(type'string'nullabletrue)]
  19.     private $type;
  20.     #[ORM\Column(type'string'nullabletrue)]
  21.     private $invoicenumber;
  22.     #[ORM\Column(type'string'nullabletrue)]
  23.     private $filename;
  24.     #[ORM\Column(type'json'nullabletrue)]
  25.     private $paypal_transaction;
  26.     #[ORM\Column(type'decimal'nullabletruescale2precision6)]
  27.     private $value;
  28.     #[ORM\Column(type'decimal'nullabletrueprecision6scale2)]
  29.     private $net_value;
  30.     #[ORM\Column(type'decimal'nullabletrueprecision6scale2)]
  31.     private $vat_value;
  32.     #[ORM\Column(type'decimal'nullabletrueprecision6scale2)]
  33.     private $vat_rate;
  34.     #[ORM\Column(type'datetime'nullabletrue)]
  35.     private $date_invoice;
  36.     #[ORM\Column(type'datetime'nullablefalse)]
  37.     private $date_created;
  38.     #[ORM\OneToMany(targetEntity'App\Entity\Payment'mappedBy'invoice')]
  39.     private $payments;
  40.     #[ORM\ManyToOne(targetEntity'App\Entity\User'inversedBy'invoice')]
  41.     #[ORM\JoinColumn(name'user_id'referencedColumnName'id'nullablefalse)]
  42.     private $user;
  43.     public function __construct()
  44.     {
  45.         $this->payments = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getPositions()
  52.     {
  53.         return $this->positions;
  54.     }
  55.     public function setPositions($positions): self
  56.     {
  57.         $this->positions $positions;
  58.         return $this;
  59.     }
  60.     public function getAddress()
  61.     {
  62.         return $this->address;
  63.     }
  64.     public function setAddress($address): self
  65.     {
  66.         $this->address $address;
  67.         return $this;
  68.     }
  69.     public function getType(): ?string
  70.     {
  71.         return $this->type;
  72.     }
  73.     public function setType(?string $type): self
  74.     {
  75.         $this->type $type;
  76.         return $this;
  77.     }
  78.     public function getInvoicenumber(): ?string
  79.     {
  80.         return $this->invoicenumber;
  81.     }
  82.     public function setInvoicenumber(?string $invoicenumber): self
  83.     {
  84.         $this->invoicenumber $invoicenumber;
  85.         return $this;
  86.     }
  87.     public function getPaypalTransaction()
  88.     {
  89.         return $this->paypal_transaction;
  90.     }
  91.     public function setPaypalTransaction($paypal_transaction): self
  92.     {
  93.         $this->paypal_transaction $paypal_transaction;
  94.         return $this;
  95.     }
  96.     public function getDateInvoice(): ?\DateTimeInterface
  97.     {
  98.         return $this->date_invoice;
  99.     }
  100.     public function setDateInvoice(?\DateTimeInterface $date_invoice): self
  101.     {
  102.         $this->date_invoice $date_invoice;
  103.         return $this;
  104.     }
  105.     public function getDateCreated(): ?\DateTimeInterface
  106.     {
  107.         return $this->date_created;
  108.     }
  109.     public function setDateCreated(?\DateTimeInterface $date_created): self
  110.     {
  111.         $this->date_created $date_created;
  112.         return $this;
  113.     }
  114.     public function getUser(): ?User
  115.     {
  116.         return $this->user;
  117.     }
  118.     public function setUser(?User $user): self
  119.     {
  120.         $this->user $user;
  121.         return $this;
  122.     }
  123.     public function addPayment(Payment $payment): self
  124.     {
  125.         if (!$this->payments->contains($payment)) {
  126.             $this->payments[] = $payment;
  127.             $payment->setInvoice($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function removePayment(Payment $payment): self
  132.     {
  133.         if ($this->payments->contains($payment)) {
  134.             $this->payments->removeElement($payment);
  135.             // set the owning side to null (unless already changed)
  136.             if ($payment->getInvoice() === $this) {
  137.                 $payment->setInvoice(null);
  138.             }
  139.         }
  140.         return $this;
  141.     }
  142.     public function getValue()
  143.     {
  144.         return $this->value;
  145.     }
  146.     public function setValue($value): self
  147.     {
  148.         $this->value $value;
  149.         return $this;
  150.     }
  151.     public function getVatValue()
  152.     {
  153.         return $this->vat_value;
  154.     }
  155.     public function setVatValue($vat_value): self
  156.     {
  157.         $this->vat_value $vat_value;
  158.         return $this;
  159.     }
  160.     public function getVatRate()
  161.     {
  162.         return $this->vat_rate;
  163.     }
  164.     public function setVatRate($vat_rate): self
  165.     {
  166.         $this->vat_rate $vat_rate;
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return Collection|Payment[]
  171.      */
  172.     public function getPayment(): Collection
  173.     {
  174.         return $this->payment;
  175.     }
  176.     public function getFilename(): ?string
  177.     {
  178.         return $this->filename;
  179.     }
  180.     public function setFilename(?string $filename): self
  181.     {
  182.         $this->filename $filename;
  183.         return $this;
  184.     }
  185.     public function getNetValue()
  186.     {
  187.         return $this->net_value;
  188.     }
  189.     public function setNetValue($net_value): self
  190.     {
  191.         $this->net_value $net_value;
  192.         return $this;
  193.     }
  194. }