You are here

public function Search::__construct in Google Site Search 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\Language\LanguageManagerInterface $language_manager: The language manager.

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

\GuzzleHttp\Client $http_client: The http client.

\Drupal\key\KeyRepository $key_repository: The key repository.

Overrides ConfigurableSearchPluginBase::__construct

File

src/Plugin/Search/Search.php, line 114

Class

Search
Handles search using Google Search Engine.

Namespace

Drupal\gss\Plugin\Search

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, Client $http_client, KeyRepository $key_repository) {
  $this->languageManager = $language_manager;
  $this->moduleHandler = $module_handler;
  $this->httpClient = $http_client;
  $this->keyRepository = $key_repository;
  parent::__construct($configuration, $plugin_id, $plugin_definition);

  // Allow overrides, e.g. different search engines per language.
  $this
    ->setConfiguration($configuration);
}