IndexPluginBase.php in Search API 8
File
src/Plugin/IndexPluginBase.php
View source
<?php
namespace Drupal\search_api\Plugin;
use Drupal\search_api\IndexInterface;
abstract class IndexPluginBase extends ConfigurablePluginBase implements IndexPluginInterface {
protected $index;
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);
}
public function getIndex() {
return $this->index;
}
public function setIndex(IndexInterface $index) {
$this->index = $index;
}
}