function field_sql_storage_field_storage_purge

7.x field_sql_storage.module field_sql_storage_field_storage_purge($entity_type, $entity, $field, $instance)

Implements hook_field_storage_purge().

This function deletes data from the database for a single field on an entity.

2 calls to field_sql_storage_field_storage_purge()
field_sql_storage_field_storage_delete in drupal-7.x/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_delete().
hook_field_storage_delete in drupal-7.x/modules/field/field.api.php
Delete all field data for an entity.

File

drupal-7.x/modules/field/modules/field_sql_storage/field_sql_storage.module, line 479
Default implementation of the field storage API.

Code

function field_sql_storage_field_storage_purge($entity_type, $entity, $field, $instance) {
  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);

  $table_name = _field_sql_storage_tablename($field);
  $revision_name = _field_sql_storage_revision_tablename($field);
  db_delete($table_name)
    ->condition('entity_type', $entity_type)
    ->condition('entity_id', $id)
    ->execute();
  db_delete($revision_name)
    ->condition('entity_type', $entity_type)
    ->condition('entity_id', $id)
    ->execute();
}