You are here

public function SearchApiEntityDataSourceController::getConfigurationSummary in Search API 7

Returns a summary of an index's current datasource configuration.

Parameters

SearchApiIndex $index: The index whose datasource configuration should be summarized.

Return value

string|null A translated string describing the index's current datasource configuration. Or NULL, if there is no configuration (or no description is available).

Overrides SearchApiAbstractDataSourceController::getConfigurationSummary

File

includes/datasource_entity.inc, line 304
Contains the SearchApiEntityDataSourceController class.

Class

SearchApiEntityDataSourceController
Represents a datasource for all entities known to the Entity API.

Code

public function getConfigurationSummary(SearchApiIndex $index) {
  if ($bundles = $this
    ->getIndexBundles($index)) {
    $args['!bundles'] = implode(', ', array_intersect_key($this
      ->getAvailableBundles(), $bundles));
    return format_plural(count($bundles), 'Indexed bundle: !bundles.', 'Indexed bundles: !bundles.', $args);
  }
  return NULL;
}