trait BackendTrait in Search API Solr 4.x
Same name in this branch
- 4.x src/Controller/BackendTrait.php \Drupal\search_api_solr\Controller\BackendTrait
- 4.x src/Plugin/search_api_autocomplete/suggester/BackendTrait.php \Drupal\search_api_solr\Plugin\search_api_autocomplete\suggester\BackendTrait
Same name and namespace in other branches
- 8.3 src/Controller/BackendTrait.php \Drupal\search_api_solr\Controller\BackendTrait
Provides a listing of Solr Entities.
Hierarchy
- trait \Drupal\search_api_solr\Controller\BackendTrait
File
- src/
Controller/ BackendTrait.php, line 11
Namespace
Drupal\search_api_solr\ControllerView source
trait BackendTrait {
/**
* The Search API server backend.
*
* @var \Drupal\search_api_solr\SolrBackendInterface
*/
protected $backend;
/**
* The Search API server ID.
*
* @var string
*/
protected $serverId = '';
/**
* The Solr minimum version string.
*
* @var string
*/
protected $assumedMinimumVersion = '';
/**
* Reset.
*
* @var bool
*/
protected $reset = FALSE;
/**
* Sets the Search API server and calls setBackend() afterwards.
*
* @param \Drupal\search_api\ServerInterface $server
* The Search API server entity.
*
* @throws \Drupal\search_api\SearchApiException
*/
public function setServer(ServerInterface $server) {
/* @var SolrBackendInterface $backend */
$backend = $server
->getBackend();
$this
->setBackend($backend);
$this->serverId = $server
->id();
}
/**
* Sets the Search API server backend.
*
* @param \Drupal\search_api_solr\SolrBackendInterface $backend
* The Search API server backend.
*/
public function setBackend(SolrBackendInterface $backend) {
$this->backend = $backend;
$this->reset = TRUE;
}
/**
* Returns the Search API server backend.
*
* @return \Drupal\search_api_solr\SolrBackendInterface
* The Search API server backend.
*/
protected function getBackend() {
return $this->backend;
}
/**
* Set assumed minimum version.
*
* @param \Drupal\search_api_solr\Controller\string $assumedMinimumVersion
* Assumed minimum version.
*/
public function setAssumedMinimumVersion(string $assumedMinimumVersion) {
$this->assumedMinimumVersion = $assumedMinimumVersion;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BackendTrait:: |
protected | property | The Solr minimum version string. | |
BackendTrait:: |
protected | property | The Search API server backend. | |
BackendTrait:: |
protected | property | Reset. | |
BackendTrait:: |
protected | property | The Search API server ID. | |
BackendTrait:: |
protected | function | Returns the Search API server backend. | |
BackendTrait:: |
public | function | Set assumed minimum version. | |
BackendTrait:: |
public | function | Sets the Search API server backend. | |
BackendTrait:: |
public | function | Sets the Search API server and calls setBackend() afterwards. |