You are here

function bean_usage_blockreference_fields in Bean (for Drupal 7) 7

Get all fields that are of type blockreference and not deleted

Return value

mixed

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

File

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

Code

function bean_usage_blockreference_fields() {
  $fields =& drupal_static(__FUNCTION__);
  if (!isset($fields)) {
    $query = db_select('field_config', 'fc');
    $query
      ->addField('fc', 'field_name', 'name');
    $query
      ->leftJoin('field_config_instance', 'fci', 'fc.field_name = fci.field_name');
    $fields = $query
      ->condition('fc.type', 'blockreference')
      ->condition('fc.deleted', 0)
      ->orderBy('fc.field_name', 'asc')
      ->execute()
      ->fetchAll(0);
  }
  return $fields;
}