You are here

protected function SynonymsEntity::valueSubmit 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::valueSubmit()

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

Overrides FilterPluginBase::valueSubmit

File

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

Class

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

Namespace

Drupal\synonyms_views_filter\Plugin\views\filter

Code

protected function valueSubmit($form, FormStateInterface $form_state) {
  parent::valueSubmit($form, $form_state);
  $target_ids = array_map(function ($item) {
    return $item['target_id'];
  }, $form_state
    ->getValue($form['value']['#parents']));
  $form_state
    ->setValueForElement($form['value'], $target_ids);
}