public static function MostPopularInterval::reset in Drupal Most Popular 6
Same name and namespace in other branches
- 7 classes/intervals.php \MostPopularInterval::reset()
Resets the list of intervals to the default settings.
2 calls to MostPopularInterval::reset()
- mostpopular_install in ./
mostpopular.install - Implements hook_install().
- mostpopular_intervals_form_submit in ./
mostpopular.admin.inc
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();
}