You are here

public function Invoice::setItems in Commerce Invoice 8.2

Sets the invoice items.

Parameters

\Drupal\commerce_invoice\Entity\InvoiceItemInterface[] $invoice_items: The invoice items.

Return value

$this

Overrides InvoiceInterface::setItems

File

src/Entity/Invoice.php, line 237

Class

Invoice
Defines the invoice entity class.

Namespace

Drupal\commerce_invoice\Entity

Code

public function setItems(array $invoice_items) {
  $this
    ->set('invoice_items', $invoice_items);
  $this
    ->recalculateTotalPrice();
  return $this;
}