function lingotek_managed_entity in Lingotek Translation 7.5        
                          
                  
                        Same name and namespace in other branches
- 7.7 lingotek.util.inc \lingotek_managed_entity()
- 7.6 lingotek.util.inc \lingotek_managed_entity()
3 calls to lingotek_managed_entity()
  - lingotek_field_language_alter in ./lingotek.module
- Implements hook_field_language_alter().
- lingotek_form_node_form_alter in ./lingotek.module
- Implements hook_form_BASE_FORM_ID_alter().
- lingotek_node_view in ./lingotek.module
- Implements hook_node_view().
File
 
   - ./lingotek.util.inc, line 1950
- Utility functions.
Code
function lingotek_managed_entity($entity_type, $entity) {
  list($id, $vid, $bundle) = lingotek_entity_extract_ids($entity_type, $entity);
  
  if (!$bundle) {
    return FALSE;
  }
  
  if (!$id) {
    return lingotek_enabled_bundle($entity_type, $bundle);
  }
  
  $query = db_select('{lingotek_entity_metadata}', 'lem')
    ->fields('lem', array(
    'value',
  ))
    ->condition('lem.entity_type', $entity_type)
    ->condition('lem.entity_id', $id)
    ->condition('lem.entity_key', 'profile');
  $result = $query
    ->execute()
    ->fetchField();
  if ($result !== FALSE) {
    if ($result === LingotekSync::PROFILE_DISABLED) {
      return FALSE;
    }
    else {
      return TRUE;
    }
  }
  
  return lingotek_enabled_bundle($entity_type, $bundle);
}