field_purge_instance

Versions
7
field_purge_instance($instance)

Purge a field instance record from the database.

This function assumes all data for the instance has already been purged, and should only be called by field_purge_batch().

Parameters

$instance The instance record to purge.

▾ 1 function calls field_purge_instance()

field_purge_batch in modules/field/field.crud.inc
Purge some deleted Field API data, instances, or fields.

Code

modules/field/field.crud.inc, line 1044

<?php
function field_purge_instance($instance) {
  db_delete('field_config_instance')
    ->condition('id', $instance['id'])
    ->execute();

  // Notify the storage engine.
  $field = field_info_field_by_id($instance['field_id']);
  module_invoke($field['storage']['module'], 'field_storage_purge_instance', $instance);

  // Clear the cache.
  field_info_cache_clear();

  // Invoke external hooks after the cache is cleared for API consistency.
  module_invoke_all('field_purge_instance', $instance);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.