You are here

public function SearchApiEntityDataSourceController::getItemLabel in Search API 7

Retrieves a human-readable label for an item.

Parameters

mixed $item: An item of this controller's type.

Return value

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

Throws

SearchApiDataSourceException If any error state was encountered.

Overrides SearchApiAbstractDataSourceController::getItemLabel

File

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

Class

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

Code

public function getItemLabel($item) {
  $label = entity_label($this->entityType, $item);
  return $label ? $label : NULL;
}