You are here

public function LineItemCollection::setLineItem in Payment 8.2

Sets a line item.

Parameters

\Drupal\payment\Plugin\Payment\LineItem\PaymentLineItemInterface $line_item:

Return value

static

Overrides LineItemCollectionInterface::setLineItem

1 call to LineItemCollection::setLineItem()
LineItemCollection::setLineItems in src/LineItemCollection.php
Sets line items.

File

src/LineItemCollection.php, line 71

Class

LineItemCollection
Provides a line item collection.

Namespace

Drupal\payment

Code

public function setLineItem(PaymentLineItemInterface $line_item) {
  $this->lineItems[$line_item
    ->getName()] = $line_item;
  return $this;
}