You are here

protected static function PaymentLineItemsInput::initializeLineItems in Payment 8.2

Initializes stored line items.

Parameters

mixed[] $element:

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

bool

2 calls to PaymentLineItemsInput::initializeLineItems()
PaymentLineItemsInput::process in src/Element/PaymentLineItemsInput.php
Implements form #process callback.
PaymentLineItemsInput::valueCallback in src/Element/PaymentLineItemsInput.php
Determines how user input is mapped to an element's #value property.

File

src/Element/PaymentLineItemsInput.php, line 399

Class

PaymentLineItemsInput
Provides a payment line items configuration element.

Namespace

Drupal\payment\Element

Code

protected static function initializeLineItems(array $element, FormStateInterface $form_state) {
  if (!$form_state
    ->has('payment.element.payment_line_items_input.configured.' . $element['#name'])) {
    static::setLineItems($element, $form_state, $element['#default_value']);
  }
}