You are here

function search_api_get_multi_type_item_label in Search API 7

Retrieves a human-readable label for a multi-type index item.

Provided as a non-object alternative to SearchApiCombinedEntityDataSourceController::getItemLabel() so it can be used as a getter callback.

Parameters

object $item: An item of the "multiple" item type.

Return value

string|null Either a human-readable label for the item, or NULL if none is available.

1 call to search_api_get_multi_type_item_label()
SearchApiCombinedEntityDataSourceController::getItemLabel in includes/datasource_multiple.inc
Retrieves a human-readable label for an item.
1 string reference to 'search_api_get_multi_type_item_label'
SearchApiCombinedEntityDataSourceController::getPropertyInfo in includes/datasource_multiple.inc
Retrieves the property info for this item type.

File

./search_api.module, line 3189
Provides a flexible framework for implementing search services.

Code

function search_api_get_multi_type_item_label($item) {
  $label = entity_label($item->item_type, $item->{$item->item_type});
  return $label ? $label : NULL;
}