You are here

public function IndexPluginBase::__construct in Search API 8

Constructs a \Drupal\Component\Plugin\PluginBase 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.

Overrides ConfigurablePluginBase::__construct

1 call to IndexPluginBase::__construct()
Highlight::__construct in src/Plugin/search_api/processor/Highlight.php
Constructs a \Drupal\Component\Plugin\PluginBase object.
2 methods override IndexPluginBase::__construct()
ContentEntity::__construct in src/Plugin/search_api/datasource/ContentEntity.php
Constructs a \Drupal\Component\Plugin\PluginBase object.
Highlight::__construct in src/Plugin/search_api/processor/Highlight.php
Constructs a \Drupal\Component\Plugin\PluginBase object.

File

src/Plugin/IndexPluginBase.php, line 22

Class

IndexPluginBase
Provides a base class for plugins linked to a search index.

Namespace

Drupal\search_api\Plugin

Code

public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
  if (($configuration['#index'] ?? NULL) instanceof IndexInterface) {
    $this
      ->setIndex($configuration['#index']);
    unset($configuration['#index']);
  }
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}