You are here

public function FileSearch::__construct in Search File Attachments 8

Constructs a \Drupal\node\Plugin\Search\NodeSearch object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Database\Connection $database: A database connection object.

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: An entity manager object.

\Drupal\Core\Config\Config $search_settings: A config object for 'search.settings'.

\Drupal\Core\Config\Config $module_settings: A config object for 'search_file_attachments.settings'.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Session\AccountInterface $account: The $account object to use for checking for access to advanced search.

Overrides PluginBase::__construct

File

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

Class

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

Namespace

Drupal\search_file_attachments\Plugin\Search

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, EntityManagerInterface $entity_manager, Config $search_settings, Config $module_settings, LanguageManagerInterface $language_manager, AccountInterface $account = NULL) {
  $this->database = $database;
  $this->entityManager = $entity_manager;
  $this->searchSettings = $search_settings;
  $this->moduleSettings = $module_settings;
  $this->languageManager = $language_manager;
  $this->account = $account;
  $this
    ->setIncludedMimetypes();
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}