You are here

function mostpopular_interval_load_by_block in Drupal Most Popular 7

Gets the configured intervals for the given block.

Parameters

integer $bid The ID of the block.:

4 calls to mostpopular_interval_load_by_block()
mostpopular_block_delete in ./mostpopular.module
mostpopular_block_view in ./mostpopular.module
Implements hook_block_view().
mostpopular_intervals_admin_form in ./mostpopular.intervals.inc
mostpopular_refresh in ./mostpopular.module
Refreshes data from each service by invoking the refresh callback for each service.

File

./mostpopular.module, line 570
The main file for the Most Popular module.

Code

function mostpopular_interval_load_by_block($bid) {
  $intervals =& drupal_static(__FUNCTION__, array());
  if (!isset($intervals[$bid])) {
    $intervals[$bid] = db_select('mostpopular_interval', 'i')
      ->fields('i')
      ->condition('bid', $bid)
      ->orderBy('weight', 'ASC')
      ->execute()
      ->fetchAllAssoc('iid');
  }
  return $intervals[$bid];
}