You are here

function bundle_inherit_install in Bundle Inherit 7

Implements hook_install().

File

./bundle_inherit.install, line 46
Bundle Inherit module install file.

Code

function bundle_inherit_install() {
  $entity_types = entity_get_info();

  // Set empty string as a parent bundle to the bundles which already exist
  foreach ($entity_types as $type_name => $type) {
    foreach ($type['bundles'] as $bundle_name => $bundle) {
      db_insert('bundle_inherit')
        ->fields(array(
        'entity_type' => $type_name,
        'bundle' => $bundle_name,
        'bundle_parent' => '',
      ))
        ->execute();
    }
  }
}