You are here

function field_test_field_storage_delete in SimpleTest 7

Implement hook_field_storage_delete().

File

tests/field_test.module, line 867

Code

function field_test_field_storage_delete($obj_type, $object, $fields) {
  list($id, $vid, $bundle) = field_extract_ids($obj_type, $object);

  // 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($obj_type, $object, $field, $instance);
    }
  }
}