You are here

public static function MultiValue::getElementState in SAML Authentication 4.x

Same name and namespace in other branches
  1. 8.3 src/Element/MultiValue.php \Drupal\samlauth\Element\MultiValue::getElementState()

Retrieves processing information about the element from $form_state.

This method is static so that it can be used in static Form API callbacks.

Parameters

array $parents: The array of #parents where the element lives in the form.

string $element_name: The field name.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

array An array with the following key/value pairs:

  • items_count: The number of sub-elements to display for the element.

See also

\Drupal\Core\Field\WidgetBase::getWidgetState()

2 calls to MultiValue::getElementState()
MultiValue::addMoreSubmit in src/Element/MultiValue.php
Handles the "Add another item" button AJAX request.
MultiValue::processMultiValue in src/Element/MultiValue.php
Processes a multi-value form element.

File

src/Element/MultiValue.php, line 482

Class

MultiValue
Provides a multi-value form element.

Namespace

Drupal\samlauth\Element

Code

public static function getElementState(array $parents, string $element_name, FormStateInterface $form_state) : ?array {
  return NestedArray::getValue($form_state
    ->getStorage(), static::getElementStateParents($parents, $element_name));
}