public static function MostPopularService::reset in Drupal Most Popular 6
Same name and namespace in other branches
- 7 classes/services.php \MostPopularService::reset()
Resets the titles for each of the services to the defaults.
1 call to MostPopularService::reset()
File
- classes/
services.php, line 163 - Defines a wrapper for the mostpopular_services table.
Class
- MostPopularService
- @file Defines a wrapper for the mostpopular_services table.
Code
public static function reset() {
// Remove the titles from the database
$sql = 'UPDATE {' . self::$table . '} SET title = null';
db_query($sql);
// Clear the cache and fetch the services again
self::clear();
$services = self::fetchSorted();
foreach ($services as $service) {
$service
->save();
}
}