You are here

function bundle_inherit_field_attach_rename_bundle in Bundle Inherit 7

Implements hook_field_attach_rename_bundle().

File

./bundle_inherit.module, line 339
Bundle Inherit module.

Code

function bundle_inherit_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
  db_update('bundle_inherit')
    ->condition('entity_type', $entity_type)
    ->condition('bundle', $bundle_old)
    ->fields(array(
    'bundle' => $bundle_new,
  ))
    ->execute();
  db_update('bundle_inherit')
    ->condition('entity_type', $entity_type)
    ->condition('bundle_parent', $bundle_old)
    ->fields(array(
    'bundle_parent' => $bundle_new,
  ))
    ->execute();
}