You are here

public function UnsavedIndexConfiguration::getDatasource in Search API 8

Retrieves a specific datasource plugin for this index.

Parameters

string $datasource_id: The ID of the datasource plugin to return.

Return value

\Drupal\search_api\Datasource\DatasourceInterface The datasource plugin with the given ID.

Throws

\Drupal\search_api\SearchApiException Thrown if the specified datasource isn't enabled for this index, or couldn't be loaded.

Overrides IndexInterface::getDatasource

File

src/UnsavedIndexConfiguration.php, line 262

Class

UnsavedIndexConfiguration
Represents a configuration of an index that was not yet permanently saved.

Namespace

Drupal\search_api

Code

public function getDatasource($datasource_id) {
  return $this->entity
    ->getDatasource($datasource_id);
}