1 field_test.storage.inc field_test_field_storage_delete_revision($entity_type, $entity, $fields)

Implements hook_field_storage_delete_revision().

File

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

Code

function field_test_field_storage_delete_revision($entity_type, $entity, $fields) {
  $data = _field_test_storage_data();

  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
  foreach ($fields as $field_name) {
    $field_data = &$data[$field_name];
    foreach (array('current', 'revisions') as $sub_table) {
      foreach ($field_data[$sub_table] as $key => $row) {
        if ($row->type == $entity_type && $row->entity_id == $id && $row->revision_id == $vid) {
          unset($field_data[$sub_table][$key]);
        }
      }
    }
  }

  _field_test_storage_data($data);
}