public function SynonymsEntity::submitExtraOptionsForm in Synonyms 2.0.x
Same name and namespace in other branches
- 8 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
- modules/
synonyms_views_filter/ src/ Plugin/ views/ filter/ SynonymsEntity.php, line 145
Class
- SynonymsEntity
- Filter entity by its name or one of its synonyms.
Namespace
Drupal\synonyms_views_filter\Plugin\views\filterCode
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);
}
}