You are here

function lingotek_entity_extract_ids in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.util.inc \lingotek_entity_extract_ids()
  2. 7.6 lingotek.util.inc \lingotek_entity_extract_ids()
10 calls to lingotek_entity_extract_ids()
LingotekEntity::getId in lib/Drupal/lingotek/LingotekEntity.php
Return the node ID
lingotek_entity_download in ./lingotek.module
lingotek_entity_load in ./lingotek.module
Implements hook_entity_load().
lingotek_entity_save in ./lingotek.module
lingotek_entity_update in ./lingotek.module
Implements hook_entity_update().

... See full list

File

./lingotek.util.inc, line 1980
Utility functions.

Code

function lingotek_entity_extract_ids($entity_type, $entity) {
  try {
    list($entity_id, $vid, $bundle_name) = entity_extract_ids($entity_type, $entity);
  } catch (EntityMalformedException $ex) {

    // check for non-standard entity types
    if ($entity_type == 'taxonomy_term') {

      // TODO: populate taxonomy_term's entity fields
      $entity_id = $entity->tid;
      $vid = NULL;
      $bundle_name = $entity->type;
    }
  }
  return array(
    $entity_id,
    $vid,
    $bundle_name,
  );
}