Return the label of an entity.
Callback for hook_entity_info().
$entity: The entity for which to generate the label.
$entity_type: The entity type; e.g., 'node' or 'user'.
An unsanitized string with the label of the entity.
function callback_entity_info_label($entity, $entity_type) {
return empty($entity->title) ? 'Untitled entity' : $entity->title;
}