You are here

public static function MostPopularInterval::fetch in Drupal Most Popular 6

Same name and namespace in other branches
  1. 7 classes/intervals.php \MostPopularInterval::fetch()

Fetches an interval object for the given interval ID.

Parameters

integer $iid: The interval ID.

Return value

MostPopularInterval The interval with the given ID, or null if none could be found.

1 call to MostPopularInterval::fetch()
mostpopular_block in ./mostpopular.module
Implements hook_block() to create the most popular block.

File

classes/intervals.php, line 179
Defines a wrapper for the mostpopular_intervals table.

Class

MostPopularInterval
@file Defines a wrapper for the mostpopular_intervals table.

Code

public static function fetch($iid) {
  $sql = 'SELECT * FROM {' . self::$table . '} WHERE iid = %d';
  $result = db_query($sql, (int) $iid);
  if ($row = db_fetch_object($result)) {
    return new MostPopularInterval($row);
  }
  return NULL;
}