You are here

function field_test_field_storage_delete in Drupal 7

Implements hook_field_storage_delete().

File

modules/field/tests/field_test.storage.inc, line 189
Defines a field storage backend.

Code

function field_test_field_storage_delete($entity_type, $entity, $fields) {
  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);

  // Note: reusing field_test_storage_purge(), like field_sql_storage.module
  // does, is highly inefficient in our case...
  foreach (field_info_instances($bundle) as $instance) {
    if (isset($fields[$instance['field_id']])) {
      $field = field_info_field_by_id($instance['field_id']);
      field_test_field_storage_purge($entity_type, $entity, $field, $instance);
    }
  }
}