You are here

public function Server::setBackendConfig in Search API 8

Sets the configuration of this server's backend plugin.

Parameters

array $backend_config: The new configuration for the backend.

Return value

$this

Overrides ServerInterface::setBackendConfig

File

src/Entity/Server.php, line 168

Class

Server
Defines the search server configuration entity.

Namespace

Drupal\search_api\Entity

Code

public function setBackendConfig(array $backend_config) {
  $this->backend_config = $backend_config;

  // In case the backend plugin is already loaded, make sure the configuration
  // stays in sync.
  if ($this->backendPlugin && $this
    ->getBackend()
    ->getConfiguration() !== $backend_config) {
    $this
      ->getBackend()
      ->setConfiguration($backend_config);
  }
  return $this;
}