You are here

public function EntityFormField::submitFormCalculateOptions in Views Entity Form Field 8

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

src/Plugin/views/field/EntityFormField.php, line 428

Class

EntityFormField
Defines a views form element for an entity field widget.

Namespace

Drupal\views_entity_form_field\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;
}