field_purge_field
- Versions
- 7
field_purge_field($field)
Purge a field record from the database.
This function assumes all instances for the field has already been purged, and should only be called by field_purge_batch().
Parameters
$field The field record to purge.
Code
modules/field/field.crud.inc, line 1069
<?php
function field_purge_field($field) {
$instances = field_read_instances(array('field_id' => $field['id']), array('include_deleted' => 1));
if (count($instances) > 0) {
throw new FieldException("Attempt to purge a field that still has instances.");
}
db_delete('field_config')
->condition('id', $field['id'])
->execute();
// Notify the storage engine.
module_invoke($field['storage']['module'], 'field_storage_purge_field', $field);
// Clear the cache.
field_info_cache_clear();
// Invoke external hooks after the cache is cleared for API consistency.
module_invoke_all('field_purge_field', $field);
}
?>Login or register to post comments 