PluginBase.php in Search API Autocomplete 8
File
src/Plugin/PluginBase.php
View source
<?php
namespace Drupal\search_api_autocomplete\Plugin;
use Drupal\search_api\Plugin\ConfigurablePluginBase;
use Drupal\search_api_autocomplete\SearchInterface;
abstract class PluginBase extends ConfigurablePluginBase implements PluginInterface {
protected $search;
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);
}
public function getSearch() {
return $this->search;
}
public function setSearch(SearchInterface $search) {
$this->search = $search;
return $this;
}
}
Classes
Name |
Description |
PluginBase |
Provides a common base class for autocomplete search plugins. |