function entity_translation_test_entity_translation_delete in Entity Translation 7
Implements hook_entity_translation_delete().
File
- tests/
entity_translation_test.module, line 66 - Testing functionality for Entity Translation module.
Code
function entity_translation_test_entity_translation_delete($entity_type, $entity, $langcode) {
list($id, , ) = entity_extract_ids($entity_type, $entity);
$row = db_select('entity_translation', 'et')
->fields('et')
->condition('entity_type', $entity_type)
->condition('entity_id', $id)
->condition('language', $langcode)
->orderBy('created')
->execute()
->fetch(PDO::FETCH_ASSOC);
$info = variable_get('entity_translation_test_delete', array());
$info[$langcode] = empty($row);
variable_set('entity_translation_test_delete', $info);
}