You are here

public function LayoutBuilderWidget::extractFormValues in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/Field/FieldWidget/LayoutBuilderWidget.php \Drupal\layout_builder\Plugin\Field\FieldWidget\LayoutBuilderWidget::extractFormValues()
  2. 9 core/modules/layout_builder/src/Plugin/Field/FieldWidget/LayoutBuilderWidget.php \Drupal\layout_builder\Plugin\Field\FieldWidget\LayoutBuilderWidget::extractFormValues()

Extracts field values from submitted form values.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field values. This parameter is altered by reference to receive the incoming form values.

array $form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form.

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

Overrides WidgetBase::extractFormValues

File

core/modules/layout_builder/src/Plugin/Field/FieldWidget/LayoutBuilderWidget.php, line 56

Class

LayoutBuilderWidget
A widget to display the layout form.

Namespace

Drupal\layout_builder\Plugin\Field\FieldWidget

Code

public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) {

  // @todo This isn't resilient to being set twice, during validation and
  //   save https://www.drupal.org/project/drupal/issues/2833682.
  if (!$form_state
    ->isValidationComplete()) {
    return;
  }
  $items
    ->setValue($this
    ->getSectionStorage($form_state)
    ->getSections());
}