You are here

public function SearchApiStandard::buildOptionsForm in Search API 8

Provide a form to edit options for this plugin.

Overrides ArgumentPluginBase::buildOptionsForm

2 calls to SearchApiStandard::buildOptionsForm()
SearchApiFulltext::buildOptionsForm in src/Plugin/views/argument/SearchApiFulltext.php
Build the options form.
SearchApiMoreLikeThis::buildOptionsForm in src/Plugin/views/argument/SearchApiMoreLikeThis.php
Build the options form.
2 methods override SearchApiStandard::buildOptionsForm()
SearchApiFulltext::buildOptionsForm in src/Plugin/views/argument/SearchApiFulltext.php
Build the options form.
SearchApiMoreLikeThis::buildOptionsForm in src/Plugin/views/argument/SearchApiMoreLikeThis.php
Build the options form.

File

src/Plugin/views/argument/SearchApiStandard.php, line 67

Class

SearchApiStandard
Defines a contextual filter for applying Search API conditions.

Namespace

Drupal\search_api\Plugin\views\argument

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  if (empty($this->definition['disable_break_phrase'])) {

    // Allow passing multiple values.
    $form['break_phrase'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Allow multiple values'),
      '#description' => $this
        ->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'),
      '#default_value' => !empty($this->options['break_phrase']),
      '#group' => 'options][more',
    ];
  }
  $form['not'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Exclude'),
    '#description' => $this
      ->t('If selected, the values entered for the filter will be excluded rather than limiting the view to those values.'),
    '#default_value' => !empty($this->options['not']),
    '#group' => 'options][more',
  ];
}