You are here

protected function SearchApiCombinedEntityDataSourceController::getEntityTypes in Search API 7

Returns the entity types for which this datasource is configured.

Depends on the index from which this method is (indirectly) called.

Parameters

SearchApiIndex $index: (optional) The index for which to get the enabled entity types. If not given, will be determined automatically.

Return value

string[] The machine names of the datasource's enabled entity types, as both keys and values.

Throws

SearchApiException Thrown if the active index could not be determined.

4 calls to SearchApiCombinedEntityDataSourceController::getEntityTypes()
SearchApiCombinedEntityDataSourceController::configurationForm in includes/datasource_multiple.inc
Form constructor for configuring the datasource for a given index.
SearchApiCombinedEntityDataSourceController::getSelectedEntityTypeOptions in includes/datasource_multiple.inc
Returns the selected entity type options for this datasource.
SearchApiCombinedEntityDataSourceController::startTracking in includes/datasource_multiple.inc
Initializes tracking of the index status of items for the given indexes.
SearchApiCombinedEntityDataSourceController::trackItemInsert in includes/datasource_multiple.inc
Starts tracking the index status for the given items on the given indexes.

File

includes/datasource_multiple.inc, line 330
Contains SearchApiCombinedEntityDataSourceController.

Class

SearchApiCombinedEntityDataSourceController
Provides a datasource for indexing multiple types of entities.

Code

protected function getEntityTypes(SearchApiIndex $index = NULL) {
  if (!$index) {
    $index = $this
      ->getCallingIndex();
  }
  if (isset($index->options['datasource']['types'])) {
    return drupal_map_assoc($index->options['datasource']['types']);
  }
  return array();
}