atr_review_save

Versions
6.1
atr_review_save($review)

Save an existing review.

Parameters

$review The ATRReview object to save.

Code

atr/atr.module, line 393

<?php
function atr_review_save($review) {
  $update = isset($review->rid) ? 'rid' : array();
  $return = drupal_write_record('atr_review', $review, $update);
  db_query("DELETE FROM {atr_review_method} WHERE rid = %d", $review->rid);
  $values = implode(',', array_fill(0, count($review->methods), "($review->rid, '%s')"));
  db_query("INSERT INTO {atr_review_method} VALUES " . $values, array_keys($review->methods));

  module_invoke_all('atr_review_save', $review);
  atr_cache_static('review_' . $review->rid, $review);

  return $return;
}
?>