You are here

public function MostPopularInterval::save in Drupal Most Popular 7

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

Stores this interval into the database.

File

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

Class

MostPopularInterval
@file Defines a wrapper for the mostpopular_intervals table.

Code

public function save() {
  if ($this->iid > 0) {
    drupal_write_record(self::$table, $this, array(
      'iid',
    ));
  }
  else {
    drupal_write_record(self::$table, $this);
    $this->iid = db_last_insert_id(self::$table, 'iid');
  }
}