fields('et') ->condition('entity_type', $entity_type) ->condition('entity_id', $id) ->condition('language', $translation['language']) ->orderBy('created') ->execute() ->fetch(PDO::FETCH_ASSOC); if ($row) { $match = TRUE; foreach ($translation as $key => $value) { if ($row[$key] != $value) { $match = FALSE; break; } } } variable_set('entity_translation_test_save', array($hook => $match)); } /** * Implements hook_entity_translation_delete(). */ 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); }