function field_test_field_storage_purge

Implements hook_field_storage_purge().

1 call to field_test_field_storage_purge()
field_test_field_storage_delete in modules/field/tests/field_test.storage.inc
Implements hook_field_storage_delete().

File

modules/field/tests/field_test.storage.inc, line 205

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.