You are here

function reviews_get_nid_from_rid in Reviews 7

Helper function to return the nid from the reviews ID.

2 calls to reviews_get_nid_from_rid()
reviews_approve_review in includes/reviews.admin.inc
Function for menu callback to approve a review.
reviews_list_confirm_delete_submit in includes/reviews.admin.inc
This function deletes the selected reviews.

File

includes/reviews.api.inc, line 128
This file contains API functions for the reviews system.

Code

function reviews_get_nid_from_rid($rid) {
  $result = db_select('reviews', 'r')
    ->fields('r', array(
    'nid',
  ))
    ->condition('rid', $rid, '=')
    ->execute()
    ->fetchAll();
  if (count($result) == 0) {
    return FALSE;
  }
  else {
    return $result[0]->nid;
  }
}