You are here

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

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

Returns the default interval.

Return value

MostPopularInterval The interval with the lowest weight.

File

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

Class

MostPopularInterval
@file Defines a wrapper for the mostpopular_intervals table.

Code

public static function getDefault() {
  $sql = 'SELECT * FROM {' . self::$table . '} ORDER BY weight ASC';
  $result = db_query_range($sql, 0, 1);
  if ($row = db_fetch_object($result)) {
    return new MostPopularInterval($row);
  }
  return NULL;
}