You are here

public static function ParagraphsSets::getWidgetState in Paragraphs Sets 8.2

Retrieves processing information about the widget 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 field lives in the form.

string $field_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 widgets to display for the field.
  • array_parents: The location of the field's widgets within the $form structure. This entry is populated at '#after_build' time.
3 calls to ParagraphsSets::getWidgetState()
ParagraphsSets::buildSelectSetSelection in src/ParagraphsSets.php
Builds select element for set selection.
ParagraphsSets::setSetSubmit in src/ParagraphsSets.php
paragraphs_sets_field_widget_multivalue_form_alter in ./paragraphs_sets.module
Implements hook_field_widget_multivalue_form_alter().

File

src/ParagraphsSets.php, line 186

Class

ParagraphsSets
Utitlity class for paragraphs_sets.

Namespace

Drupal\paragraphs_sets

Code

public static function getWidgetState(array $parents, $field_name, FormStateInterface $form_state) {
  return NestedArray::getValue($form_state
    ->getStorage(), static::getWidgetStateParents($parents, $field_name));
}