You are here

function entity_translation_entity_save in Entity Translation 7

Wrapper for entity_save().

Parameters

$entity_type: The entity type.

$entity: The entity object.

4 calls to entity_translation_entity_save()
entity_translation_delete_confirm_submit in ./entity_translation.admin.inc
Submit handler for the translation deletion confirmation.
entity_translation_overview in ./entity_translation.admin.inc
Translations overview page callback.
entity_translation_taxonomy_term_field_attach_submit in ./entity_translation.taxonomy.inc
Term-specific implementation of hook_field_attach_submit().
_entity_translation_update_field in ./entity_translation.admin.inc
Stores the given field translations.

File

./entity_translation.module, line 2120

Code

function entity_translation_entity_save($entity_type, $entity) {

  // Entity module isn't required, but use it if it's available.
  if (module_exists('entity')) {
    entity_save($entity_type, $entity);
  }
  else {
    field_attach_presave($entity_type, $entity);
    field_attach_update($entity_type, $entity);
  }
}