field_attach_delete_bundle

Versions
7
field_attach_delete_bundle($obj_type, $bundle)

Notify field.module the a bundle was deleted.

This deletes the data for the field instances as well as the field instances themselves. This function actually just marks the data and field instances and deleted, leaving the garbage collection for a separate process, because it is not always possible to delete this much data in a single page request (particularly since for some field types, the deletion is more than just a simple DELETE query).

Parameters

$obj_type The object type to which the bundle is bound.

$bundle The bundle to delete.

Related topics

Code

modules/field/field.attach.inc, line 1325

<?php
function field_attach_delete_bundle($obj_type, $bundle) {
  // First, delete the instances themseves.
  $instances = field_info_instances($obj_type, $bundle);
  foreach ($instances as $instance) {
    field_delete_instance($instance);
  }

  // Clear the cache.
  field_cache_clear();

  // Let other modules act on deleting the bundle.
  module_invoke_all('field_attach_delete_bundle', $obj_type, $bundle, $instances);
}
?>
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.