You are here

function boxes_get_all_boxes in Boxes 7.2

Load all boxes

1 call to boxes_get_all_boxes()
boxes_block_info in ./boxes.module
Implements hook_block_info().

File

./boxes.module, line 383

Code

function boxes_get_all_boxes() {
  $boxes =& drupal_static(__FUNCTION__);
  if (!isset($boxes)) {
    $query = new EntityFieldQuery();
    $result = $query
      ->entityCondition('entity_type', 'box')
      ->execute();
    if (isset($result['box'])) {
      $boxes = boxes_load_multiple(array_keys($result['box']));
    }
    else {
      $boxes = array();
    }
  }
  return $boxes;
}