You are here

public function BackendTrait::setServer in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x src/Controller/BackendTrait.php \Drupal\search_api_solr\Controller\BackendTrait::setServer()

Sets the Search API server and calls setBackend() afterwards.

Parameters

\Drupal\search_api\ServerInterface $server: The Search API server entity.

Throws

\Drupal\search_api\SearchApiException

1 call to BackendTrait::setServer()
SolrConfigSetController::streamConfigZip in src/Controller/SolrConfigSetController.php
Streams a zip archive containing a complete Solr configuration.

File

src/Controller/BackendTrait.php, line 49

Class

BackendTrait
Provides a listing of Solr Entities.

Namespace

Drupal\search_api_solr\Controller

Code

public function setServer(ServerInterface $server) {

  /* @var SolrBackendInterface $backend */
  $backend = $server
    ->getBackend();
  $this
    ->setBackend($backend);
  $this->serverId = $server
    ->id();
}