You are here

public function SearchApiAbstractDataSourceController::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 SearchApiDataSourceControllerInterface::getItemLabel

3 methods override SearchApiAbstractDataSourceController::getItemLabel()
SearchApiCombinedEntityDataSourceController::getItemLabel in includes/datasource_multiple.inc
Retrieves a human-readable label for an item.
SearchApiEntityDataSourceController::getItemLabel in includes/datasource_entity.inc
Retrieves a human-readable label for an item.
SearchApiExternalDataSourceController::getItemLabel in includes/datasource_external.inc
Get a human-readable label for an item.

File

includes/datasource.inc, line 532
Contains the SearchApiDataSourceControllerInterface as well as a default base class.

Class

SearchApiAbstractDataSourceController
Provides a default base class for datasource controllers.

Code

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