You are here

public function FilesExtractor::submitConfigurationForm in Search API attachments 8

Same name and namespace in other branches
  1. 9.0.x src/Plugin/search_api/processor/FilesExtractor.php \Drupal\search_api_attachments\Plugin\search_api\processor\FilesExtractor::submitConfigurationForm()

Form submission 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 PluginFormInterface::submitConfigurationForm

See also

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

File

src/Plugin/search_api/processor/FilesExtractor.php, line 643

Class

FilesExtractor
Provides file fields processor.

Namespace

Drupal\search_api_attachments\Plugin\search_api\processor

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $excluded_extensions = $form_state
    ->getValue('excluded_extensions');
  $excluded_extensions_array = explode(' ', $excluded_extensions);
  $excluded_mimes_array = $this->extractFileValidator
    ->getExcludedMimes($excluded_extensions_array);
  $excluded_mimes_string = implode(' ', $excluded_mimes_array);
  $this
    ->setConfiguration($form_state
    ->getValues() + [
    'excluded_mimes' => $excluded_mimes_string,
  ]);
}