You are here

protected static function PaymentLineItemsInput::setLineItems in Payment 8.2

Stores the line items in the form's state.

Parameters

mixed[] $element:

\Drupal\Core\Form\FormStateInterface $form_state:

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

4 calls to PaymentLineItemsInput::setLineItems()
PaymentLineItemsInput::addMoreSubmit in src/Element/PaymentLineItemsInput.php
Implements form #submit callback.
PaymentLineItemsInput::deleteSubmit in src/Element/PaymentLineItemsInput.php
Implements form #submit callback.
PaymentLineItemsInput::initializeLineItems in src/Element/PaymentLineItemsInput.php
Initializes stored line items.
PaymentLineItemsInput::validate in src/Element/PaymentLineItemsInput.php
Implements form #element_validate callback.

File

src/Element/PaymentLineItemsInput.php, line 361

Class

PaymentLineItemsInput
Provides a payment line items configuration element.

Namespace

Drupal\payment\Element

Code

protected static function setLineItems(array $element, FormStateInterface $form_state, array $line_items) {
  $form_state
    ->set('payment.element.payment_line_items_input.configured.' . $element['#name'], $line_items);
}