You are here

function bean_usage_blockreference_bundles in Bean (for Drupal 7) 7

Get all of the bundles used with beans via blockreference

Return value

array

1 call to bean_usage_blockreference_bundles()
bean_usage_output in bean_usage/bean_usage.module
Displays a table of Beans and their usage

File

bean_usage/bean_usage.module, line 369
Bean Admin Functions and Display

Code

function bean_usage_blockreference_bundles() {
  $bundles = array();
  $b_query = db_select('field_config_instance', 'fci')
    ->distinct();
  $b_query
    ->join('field_config', 'fc', 'fc.field_name = fci.field_name');
  $b_res = $b_query
    ->fields('fci', array(
    'bundle',
  ))
    ->condition('fc.type', 'blockreference')
    ->execute()
    ->fetchAll(0);
  foreach ($b_res as $bundle) {
    $bundles[] = $bundle->bundle;
  }
  return $bundles;
}