You are here

function _revisioning_get_number_of_pending_revisions in Revisioning 7

Same name and namespace in other branches
  1. 8 revisioning_api.inc \_revisioning_get_number_of_pending_revisions()
  2. 6.4 revisioning_api.inc \_revisioning_get_number_of_pending_revisions()
  3. 6.3 revisioning_api.inc \_revisioning_get_number_of_pending_revisions()

Return a count of the number of revisions newer than the current revision.

Parameters

int $nid: The id of the node.

Return value

int count of the number of revisions newer than the current revision

2 calls to _revisioning_get_number_of_pending_revisions()
revisioning_form_node_revision_revert_confirm_alter in ./revisioning.pages.inc
Implements hook_form_FORM_ID_alter().
revisioning_node_has_pending in ./revisioning.rules.inc
Condition: check for pending revisions of the node.

File

./revisioning_api.inc, line 645
API functions of Revisioning module

Code

function _revisioning_get_number_of_pending_revisions($nid) {
  $result = db_query("SELECT COUNT(r.vid) FROM {node} n INNER JOIN {node_revision} r ON n.nid = r.nid WHERE (r.vid > n.vid AND n.nid = :nid)", array(
    ':nid' => $nid,
  ));
  return $result
    ->fetchField();
}