Skip navigation
Help

field_sql_storage_field_storage_delete

7 field_sql_storage.module field_sql_storage_field_storage_delete($entity_type, $entity, $fields)

Implements hook_field_storage_delete().

This function deletes data for all fields for an entity from the database.

File

drupal/modules/field/modules/field_sql_storage/field_sql_storage.module, line 435
Default implementation of the field storage API.

Code

function field_sql_storage_field_storage_delete($entity_type, $entity, $fields) {
  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);

  foreach (field_info_instances($entity_type, $bundle) as $instance) {
    if (isset($fields[$instance['field_id']])) {
      $field = field_info_field_by_id($instance['field_id']);
      field_sql_storage_field_storage_purge($entity_type, $entity, $field, $instance);
    }
  }
}