function Serializer::submitOptionsForm

Same name and namespace in other branches
  1. 9 core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::submitOptionsForm()
  2. 8.9.x core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::submitOptionsForm()
  3. 11.x core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::submitOptionsForm()

Overrides PluginBase::submitOptionsForm

File

core/modules/rest/src/Plugin/views/style/Serializer.php, line 112

Class

Serializer
The style plugin for serialized output formats.

Namespace

Drupal\rest\Plugin\views\style

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
  parent::submitOptionsForm($form, $form_state);
  $formats = $form_state->getValue([
    'style_options',
    'formats',
  ]);
  $form_state->setValue([
    'style_options',
    'formats',
  ], array_filter($formats));
}

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