You are here

protected function SearchApiEntityDataSourceController::getAvailableBundles in Search API 7

Retrieves the available bundles for this entity type.

Return value

array An array (which might be empty) mapping this entity type's bundle keys to their labels.

3 calls to SearchApiEntityDataSourceController::getAvailableBundles()
SearchApiEntityDataSourceController::configurationForm in includes/datasource_entity.inc
Form constructor for configuring the datasource for a given index.
SearchApiEntityDataSourceController::getConfigurationSummary in includes/datasource_entity.inc
Returns a summary of an index's current datasource configuration.
SearchApiEntityDataSourceController::getIndexBundles in includes/datasource_entity.inc
Computes the bundles that should be indexed for an index.

File

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

Class

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

Code

protected function getAvailableBundles() {
  if (!$this->bundleKey || empty($this->entityInfo['bundles'])) {
    return array();
  }
  $bundles = array();
  foreach ($this->entityInfo['bundles'] as $bundle => $bundle_info) {
    $bundles[$bundle] = isset($bundle_info['label']) ? $bundle_info['label'] : $bundle;
  }
  return $bundles;
}