You are here

function bundle_inherit_field_attach_create_bundle in Bundle Inherit 7

Implements hook_field_attach_create_bundle().

File

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

Code

function bundle_inherit_field_attach_create_bundle($entity_type, $bundle) {
  $exists = db_query('SELECT 1 FROM {bundle_inherit} WHERE entity_type = :entity_type AND bundle = :bundle', array(
    ':entity_type' => $entity_type,
    ':bundle' => $bundle,
  ))
    ->fetchField();
  if (!$exists) {
    db_insert('bundle_inherit')
      ->fields(array(
      'entity_type' => $entity_type,
      'bundle' => $bundle,
      'bundle_parent' => '',
    ))
      ->execute();
  }
}