1 entity.module entity_label($entity_type, $entity)

Returns the label of an entity.

See the 'label callback' component of the hook_entity_info() return value for more information.

Parameters

$entity_type: The entity type; e.g., 'node' or 'user'.

$entity: The entity for which to generate the label.

Return value

The entity label, or FALSE if not found.:

File

core/modules/entity/entity.module, line 773
Entity API for handling entities like nodes or users.

Code

function entity_label($entity_type, $entity) {
  return $entity->label();
}