1 field_sql_storage.module field_sql_storage_field_storage_delete_instance($instance)

Implements hook_field_storage_delete_instance().

This function marks all data associated with the field for deletion.

File

core/modules/field/modules/field_sql_storage/field_sql_storage.module, line 672
Default implementation of the field storage API.

Code

function field_sql_storage_field_storage_delete_instance($instance) {
  $field = field_info_field($instance['field_name']);
  $table_name = _field_sql_storage_tablename($field);
  $revision_name = _field_sql_storage_revision_tablename($field);
  db_update($table_name)
    ->fields(array('deleted' => 1))
    ->condition('entity_type', $instance['entity_type'])
    ->condition('bundle', $instance['bundle'])
    ->execute();
  db_update($revision_name)
    ->fields(array('deleted' => 1))
    ->condition('entity_type', $instance['entity_type'])
    ->condition('bundle', $instance['bundle'])
    ->execute();
}