function EntityReference::submitExtraOptionsForm

Overrides HandlerBase::submitExtraOptionsForm

File

core/modules/views/src/Plugin/views/filter/EntityReference.php, line 361

Class

EntityReference
Filters a view by entity references.

Namespace

Drupal\views\Plugin\views\filter

Code

public function submitExtraOptionsForm($form, FormStateInterface $form_state) : void {
    $sub_handler = $form_state->getValue('options')['sub_handler'];
    // Ensure that only the select sub handler option is saved.
    foreach (array_keys($this->getSubHandlerOptions()) as $sub_handler_option) {
        if ($sub_handler_option == $sub_handler) {
            $this->options['sub_handler_settings'] = $this->options[static::SUBFORM_PREFIX . $sub_handler_option];
        }
        if (isset($this->options[static::SUBFORM_PREFIX . $sub_handler_option])) {
            unset($this->options[static::SUBFORM_PREFIX . $sub_handler_option]);
        }
    }
}

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