lineItems[] = $item; } public function addLineItems(array $items): void { foreach($items as $item) { $this->addLineItem($item); } } /** * @return InvoiceLineItem[] */ public function getLineItems(): array { return $this->lineItems; } public function getTotal() { $total = 0; foreach($this->lineItems as $item) { $total += $item->getTotal(); } return $total; } public function getTaxRate(): float { return $this->taxRate; } public function setTaxRate(float $tax_rate): void { $this->taxRate = $tax_rate; } public function getTax(): float { return round($this->getTotal() * $this->taxRate, 2); } public function getTotalIncTax(): float { return $this->getTotal() + $this->getTax(); } public function setReference(string $reference): void { $this->reference = $reference; } public function getReference(): string { return $this->reference; } }