function entity_label

cis7 common.inc entity_label($entity_type, $entity)
cle7 common.inc entity_label($entity_type, $entity)
elmsmedia7 common.inc entity_label($entity_type, $entity)
icor7 common.inc entity_label($entity_type, $entity)
meedjum_blog7 common.inc entity_label($entity_type, $entity)
mooc7 common.inc 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.

37 calls to entity_label()
editableviews_entity_form_submit_save in sites/all/modules/ulmus/editableviews/editableviews.module
Form submit handler the second: save entities.
Entity::label in sites/all/modules/ulmus/entity/includes/entity.inc
Returns the label of the entity.
EntityDefaultFeaturesController::export_options in sites/all/modules/ulmus/entity/entity.features.inc
Generates the result for hook_features_export_options().
EntityDefaultUIController::applyOperation in sites/all/modules/ulmus/entity/includes/entity.ui.inc
Applies an operation to the given entity.
EntityDefaultUIController::operationForm in sites/all/modules/ulmus/entity/includes/entity.ui.inc
Builds the operation form.

... See full list

4 string references to 'entity_label'
EntityDefaultUIController::hook_menu in sites/all/modules/ulmus/entity/includes/entity.ui.inc
Provides definitions for implementing hook_menu().
file_entity_menu in sites/all/modules/ulmus/file_entity/file_entity.module
Implements hook_menu().
og-7.x-1.x.database.php in sites/all/modules/ulmus/og/tests/og-7.x-1.x.database.php
Filled installation of Drupal 7.0, for test purposes.
taxonomy_menu in modules/taxonomy/taxonomy.module
Implements hook_menu().

File

includes/common.inc, line 7943
Common functions that many Drupal modules will need to reference.

Code

function entity_label($entity_type, $entity) {
  $label = FALSE;
  $info = entity_get_info($entity_type);
  if (isset($info['label callback']) && function_exists($info['label callback'])) {
    $label = $info['label callback']($entity, $entity_type);
  }
  elseif (!empty($info['entity keys']['label']) && isset($entity->{$info['entity keys']['label']})) {
    $label = $entity->{$info['entity keys']['label']};
  }

  return $label;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.