You are here

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

Same name and namespace in other branches
  1. 6 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.

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;
}