You are here

function bean_get_all_beans in Bean (for Drupal 7) 7

Load all beans

1 call to bean_get_all_beans()
bean_block_info in ./bean.module
Implements hook_block_info().
1 string reference to 'bean_get_all_beans'
bean_bean_cache_clear in ./bean.module
Implements hook_bean_cache_clear().

File

./bean.module, line 515
Block Entity

Code

function bean_get_all_beans() {
  $beans =& drupal_static(__FUNCTION__);
  if (!isset($beans)) {
    $query = new EntityFieldQuery();
    $result = $query
      ->entityCondition('entity_type', 'bean')
      ->execute();
    if (isset($result['bean'])) {
      $beans = bean_load_multiple(array_keys($result['bean']));
    }
    else {
      $beans = array();
    }
  }
  return $beans;
}