You are here

public function SynonymsEntity::submitExtraOptionsForm in Synonyms 8

Same name and namespace in other branches
  1. 2.0.x modules/synonyms_views_filter/src/Plugin/views/filter/SynonymsEntity.php \Drupal\synonyms_views_filter\Plugin\views\filter\SynonymsEntity::submitExtraOptionsForm()

Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

Overrides HandlerBase::submitExtraOptionsForm

File

synonyms_views_filter/src/Plugin/views/filter/SynonymsEntity.php, line 127

Class

SynonymsEntity
Filter entity by its name or one of its synonyms.

Namespace

Drupal\synonyms_views_filter\Plugin\views\filter

Code

public function submitExtraOptionsForm($form, FormStateInterface $form_state) {
  parent::submitExtraOptionsForm($form, $form_state);
  if (isset($form['target_bundles'])) {
    $target_bundles = array_values(array_filter($form_state
      ->getValue($form['target_bundles']['#parents'])));
    if (empty($target_bundles)) {
      $target_bundles = NULL;
    }
    $form_state
      ->setValueForElement($form['target_bundles'], $target_bundles);
  }
}