function EntityFormDisplayInterface::extractFormValues

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php \Drupal\Core\Entity\Display\EntityFormDisplayInterface::extractFormValues()
  2. 8.9.x core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php \Drupal\Core\Entity\Display\EntityFormDisplayInterface::extractFormValues()
  3. 11.x core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php \Drupal\Core\Entity\Display\EntityFormDisplayInterface::extractFormValues()

Extracts field values from the submitted widget values into the entity.

This accounts for drag-and-drop reordering of field values, and filtering of empty values.

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity.

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.

Return value

array An array whose keys and values are the keys of the top-level entries in $form_state->getValues() that have been processed. The remaining entries, if any, do not correspond to widgets and should be extracted manually by the caller if needed.

1 method overrides EntityFormDisplayInterface::extractFormValues()
EntityFormDisplay::extractFormValues in core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
Extracts field values from the submitted widget values into the entity.

File

core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php, line 119

Class

EntityFormDisplayInterface
Provides a common interface for entity form displays.

Namespace

Drupal\Core\Entity\Display

Code

public function extractFormValues(FieldableEntityInterface $entity, array &$form, FormStateInterface $form_state);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.