You are here

public function SearchApiEntityDataSourceController::getItemId in Search API 7

Retrieves the unique ID of an item.

Parameters

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

Return value

mixed Either the unique ID of the item, or NULL if none is available.

Throws

SearchApiDataSourceException If any error state was encountered.

Overrides SearchApiAbstractDataSourceController::getItemId

File

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

Class

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

Code

public function getItemId($item) {
  $id = entity_id($this->entityType, $item);
  return $id ? $id : NULL;
}