public function MostPopularService::save in Drupal Most Popular 6
Same name and namespace in other branches
- 7 classes/services.php \MostPopularService::save()
 
Saves the service, either updating an existing database record or creating a new one.
1 call to MostPopularService::save()
- MostPopularService::updateStatus in classes/
services.php  - Updates the status of this service.
 
File
- classes/
services.php, line 97  - Defines a wrapper for the mostpopular_services table.
 
Class
- MostPopularService
 - @file Defines a wrapper for the mostpopular_services table.
 
Code
public function save() {
  if ($this->sid > 0) {
    drupal_write_record(self::$table, $this, array(
      'sid',
    ));
  }
  else {
    drupal_write_record(self::$table, $this);
    // Get the new SID
    $this->sid = db_last_insert_id(self::$table, 'sid');
  }
}