You are here

function bundle_inherit_bundle_get_parent in Bundle Inherit 7

Get parent of the selected entity bundle.

Return value

Entity type parent type.

3 calls to bundle_inherit_bundle_get_parent()
bundle_inherit_access_gate in ./bundle_inherit.module
Prevent user from editing\deleting inherited field instance.
bundle_inherit_attach_inherit_form in ./bundle_inherit.module
Attach ineritance form to selected form element.
bundle_inherit_form_field_ui_field_overview_form_alter in ./bundle_inherit.module
Implements hook_form_FORMID_alter().

File

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

Code

function bundle_inherit_bundle_get_parent($entity_type, $bundle) {
  $parent =& drupal_static(__FUNCTION__);
  if (!isset($parent[$entity_type][$bundle])) {
    $parent[$entity_type][$bundle] = db_select('bundle_inherit', 'bi')
      ->fields('bi', array(
      'bundle_parent',
    ))
      ->condition('bi.bundle', $bundle)
      ->execute()
      ->fetchField();
    if (!$parent[$entity_type][$bundle]) {
      $parent[$entity_type][$bundle] = '';
    }
  }
  return $parent[$entity_type][$bundle];
}