You are here

public function PluginBase::__construct in Search API Autocomplete 8

Constructs a SearchPluginBase object.

Parameters

array $configuration: An associative array containing the plugin's configuration, if any. The "#search" key should contain the plugin's autocomplete search entity.

string $plugin_id: The plugin's ID.

array $plugin_definition: The plugin's definition.

Overrides ConfigurablePluginBase::__construct

1 call to PluginBase::__construct()
Page::__construct in src/Plugin/search_api_autocomplete/search/Page.php
Creates a new Page instance.
1 method overrides PluginBase::__construct()
Page::__construct in src/Plugin/search_api_autocomplete/search/Page.php
Creates a new Page instance.

File

src/Plugin/PluginBase.php, line 31

Class

PluginBase
Provides a common base class for autocomplete search plugins.

Namespace

Drupal\search_api_autocomplete\Plugin

Code

public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
  if (!empty($configuration['#search']) && $configuration['#search'] instanceof SearchInterface) {
    $this
      ->setSearch($configuration['#search']);
    unset($configuration['#search']);
  }
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}