You are here

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

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

Resets the list of intervals to the default settings.

File

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

Class

MostPopularInterval
@file Defines a wrapper for the mostpopular_intervals table.

Code

public static function reset() {
  self::clear();
  $day = new MostPopularInterval(array(
    'title' => t('Day'),
    'string' => '-1 day',
    'weight' => 0,
  ));
  $day
    ->save();
  $week = new MostPopularInterval(array(
    'title' => t('Week'),
    'string' => '-1 week',
    'weight' => 1,
  ));
  $week
    ->save();
  $month = new MostPopularInterval(array(
    'title' => t('Month'),
    'string' => '-1 month',
    'weight' => 2,
  ));
  $month
    ->save();
  $year = new MostPopularInterval(array(
    'title' => t('Year'),
    'string' => '-1 year',
    'weight' => 3,
  ));
  $year
    ->save();
}