You are here

function _revisioning_get_number_of_revisions_newer_than in Revisioning 7

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

Return a count of the number of revisions newer than the supplied vid.

Parameters

int $vid: The reference vid.

int $nid: The id of the node.

Return value

int count of the number of revisions newer than the supplied vid

1 call to _revisioning_get_number_of_revisions_newer_than()
revisioning_node_prepare in ./revisioning.module
Implements hook_node_prepare().

File

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

Code

function _revisioning_get_number_of_revisions_newer_than($vid, $nid) {
  $result = db_query("SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid AND vid > :vid", array(
    ':vid' => $vid,
    ':nid' => $nid,
  ));
  return $result
    ->fetchField();
}