function NodeSearch::__construct

Same name and namespace in other branches
  1. 9 core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch::__construct()
  2. 8.9.x core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch::__construct()
  3. 10 core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch::__construct()

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: The current database connection.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: A module manager object.

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

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

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger.

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

\Drupal\Core\Database\Connection|null $database_replica: The replica database connection.

\Drupal\search\SearchIndexInterface $search_index: The search index.

Overrides ConfigurableSearchPluginBase::__construct

File

core/modules/node/src/Plugin/Search/NodeSearch.php, line 193

Class

NodeSearch
Handles searching for node entities using the Search module index.

Namespace

Drupal\node\Plugin\Search

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, Config $search_settings, LanguageManagerInterface $language_manager, RendererInterface $renderer, MessengerInterface $messenger, AccountInterface $account, Connection $database_replica, SearchIndexInterface $search_index) {
    $this->database = $database;
    $this->databaseReplica = $database_replica;
    $this->entityTypeManager = $entity_type_manager;
    $this->moduleHandler = $module_handler;
    $this->searchSettings = $search_settings;
    $this->languageManager = $language_manager;
    $this->renderer = $renderer;
    $this->messenger = $messenger;
    $this->account = $account;
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->addCacheTags([
        'node_list',
    ]);
    $this->searchIndex = $search_index;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.