You are here

public function FieldsProcessorPluginBase::validateConfigurationForm in Search API 8

Form validation handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

Overrides PluginFormTrait::validateConfigurationForm

See also

\Drupal\Core\Plugin\PluginFormInterface::validateConfigurationForm()

4 calls to FieldsProcessorPluginBase::validateConfigurationForm()
HtmlFilter::validateConfigurationForm in src/Plugin/search_api/processor/HtmlFilter.php
Form validation handler.
IgnoreCharacters::validateConfigurationForm in src/Plugin/search_api/processor/IgnoreCharacters.php
Form validation handler.
Stemmer::validateConfigurationForm in src/Plugin/search_api/processor/Stemmer.php
Form validation handler.
Tokenizer::validateConfigurationForm in src/Plugin/search_api/processor/Tokenizer.php
Form validation handler.
4 methods override FieldsProcessorPluginBase::validateConfigurationForm()
HtmlFilter::validateConfigurationForm in src/Plugin/search_api/processor/HtmlFilter.php
Form validation handler.
IgnoreCharacters::validateConfigurationForm in src/Plugin/search_api/processor/IgnoreCharacters.php
Form validation handler.
Stemmer::validateConfigurationForm in src/Plugin/search_api/processor/Stemmer.php
Form validation handler.
Tokenizer::validateConfigurationForm in src/Plugin/search_api/processor/Tokenizer.php
Form validation handler.

File

src/Processor/FieldsProcessorPluginBase.php, line 273

Class

FieldsProcessorPluginBase
Provides a base class for processors that work on individual fields.

Namespace

Drupal\search_api\Processor

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('all_fields')) {
    $fields = array_filter($form_state
      ->getValue('fields', []));
    if ($fields) {
      $fields = array_keys($fields);
    }
  }
  else {
    $fields = array_keys($form['fields']['#options']);
  }
  $form_state
    ->setValue('fields', $fields);
}