You are here

public function EntityField::submitFormCalculateOptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/EntityField.php \Drupal\views\Plugin\views\field\EntityField::submitFormCalculateOptions()

Calculates options stored on the handler.

Parameters

array $options: The options stored in the handler

array $form_state_options: The newly submitted form state options.

Return value

array The new options

Overrides HandlerBase::submitFormCalculateOptions

File

core/modules/views/src/Plugin/views/field/EntityField.php, line 510

Class

EntityField
A field that displays entity field data.

Namespace

Drupal\views\Plugin\views\field

Code

public function submitFormCalculateOptions(array $options, array $form_state_options) {

  // When we change the formatter type we don't want to keep any of the
  // previous configured formatter settings, as there might be schema
  // conflict.
  unset($options['settings']);
  $options = $form_state_options + $options;
  if (!isset($options['settings'])) {
    $options['settings'] = [];
  }
  return $options;
}