You are here

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

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

Returns the default interval.

Return value

MostPopularInterval The interval with the lowest weight.

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

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