You are here

protected function FileSearch::setIncludedMimetypes in Search File Attachments 8

Set the included mimetypes.

Maps the included file types (file extensions) from the settings with the correponding mimetypes.

1 call to FileSearch::setIncludedMimetypes()
FileSearch::__construct in src/Plugin/Search/FileSearch.php
Constructs a \Drupal\node\Plugin\Search\NodeSearch object.

File

src/Plugin/Search/FileSearch.php, line 504

Class

FileSearch
Executes a keyword search for files against {file_managed} database table.

Namespace

Drupal\search_file_attachments\Plugin\Search

Code

protected function setIncludedMimetypes() {
  $mimetype_service = \Drupal::service('search_file_attachments.mimetype');
  $included_filetypes = $this->moduleSettings
    ->get('files.include');
  $this->includedMimetypes = $mimetype_service
    ->extensionsToMimetypes($included_filetypes);
}