You are here

public function Index::setServer in Search API 8

Sets the server the index is attached to.

Parameters

\Drupal\search_api\ServerInterface|null $server: The server to move this index to, or NULL.

Return value

$this

Overrides IndexInterface::setServer

1 call to Index::setServer()
Index::onDependencyRemoval in src/Entity/Index.php
Informs the entity that entities it depends on will be deleted.

File

src/Entity/Index.php, line 515

Class

Index
Defines the search index configuration entity.

Namespace

Drupal\search_api\Entity

Code

public function setServer(ServerInterface $server = NULL) {
  $this->serverInstance = $server;
  $this->server = $server ? $server
    ->id() : NULL;
  return $this;
}