You are here

public function LineItemCollection::setLineItems in Payment 8.2

Sets line items.

Parameters

\Drupal\payment\Plugin\Payment\LineItem\PaymentLineItemInterface[] $line_items:

Return value

static

Overrides LineItemCollectionInterface::setLineItems

1 call to LineItemCollection::setLineItems()
LineItemCollection::__construct in src/LineItemCollection.php
Constructs a new instance.

File

src/LineItemCollection.php, line 59

Class

LineItemCollection
Provides a line item collection.

Namespace

Drupal\payment

Code

public function setLineItems(array $line_items) {
  $this->lineItems = [];
  foreach ($line_items as $line_item) {
    $this
      ->setLineItem($line_item);
  }
  return $this;
}