function entity_id

cis7 entity.module entity_id($entity_type, $entity)
cle7 entity.module entity_id($entity_type, $entity)
elmsmedia7 entity.module entity_id($entity_type, $entity)
icor7 entity.module entity_id($entity_type, $entity)
meedjum_blog7 entity.module entity_id($entity_type, $entity)
mooc7 entity.module entity_id($entity_type, $entity)

Returns the entity identifier, i.e. the entities name or numeric id.

Unlike entity_extract_ids() this function returns the name of the entity instead of the numeric id, in case the entity type has specified a name key.

Parameters

$entity_type: The type of the entity.

$entity: An entity object.

See also

entity_extract_ids()

25 calls to entity_id()
display_cache_entity_view_alter in sites/all/modules/ulmus/display_cache/display_cache.module
Implements hook_entity_view_alter().
display_cache_field_attach_view_alter in sites/all/modules/ulmus/display_cache/display_cache.module
Implements hook_field_attach_view_alter().
display_cache_flush_cache in sites/all/modules/ulmus/display_cache/display_cache.module
Flushes the display cache of a given element.
EntityDefaultUIController::applyOperation in sites/all/modules/ulmus/entity/includes/entity.ui.inc
Applies an operation to the given entity.
EntityDefaultUIController::operationFormValidate in sites/all/modules/ulmus/entity/includes/entity.ui.inc
Operation form validation callback.

... See full list

76 string references to 'entity_id'
accessibility_reporting_report in sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/accessibility_reporting.module
Report callback. Stores posted data to accessibility_reporting table.
accessibility_reporting_schema in sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/accessibility_reporting.install
Implements hook_schema().
accessibility_reporting_views_data_alter in sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/views/accessibility_reporting.views.inc
Implements hook_views_data_alter().
cis_helper_draw_chart_alter in profiles/cis/modules/custom/cis_helper/cis_helper.module
Implements hook_draw_chart_alter().
comment_update_7006 in modules/comment/comment.install
Migrate data from the comment field to field storage.

... See full list

File

sites/all/modules/ulmus/entity/entity.module, line 575
Module file for the entity API.

Code

function entity_id($entity_type, $entity) {
  if (method_exists($entity, 'identifier')) {
    return $entity->identifier();
  }
  $info = entity_get_info($entity_type);
  $key = isset($info['entity keys']['name']) ? $info['entity keys']['name'] : $info['entity keys']['id'];
  return isset($entity->$key) ? $entity->$key : NULL;
}
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.