You are here

function _revisioning_get_pending_revisions in Revisioning 7

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

Retrieve a list of revisions with a vid greater than the current.

Parameters

int $nid: The node id to retrieve.

Return value

array An array of revisions (latest first), each containing vid, title and content type.

1 call to _revisioning_get_pending_revisions()
_revisioning_publish_latest_revision in ./revisioning_api.inc
Publish latest revision.

File

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

Code

function _revisioning_get_pending_revisions($nid) {
  $sql = "SELECT r.vid, r.title, n.type FROM {node} n INNER JOIN {node_revision} r ON n.nid = r.nid WHERE (r.vid > n.vid AND n.nid = :nid) ORDER BY r.vid DESC";
  $result = db_query($sql, array(
    ':nid' => $nid,
  ));
  $revisions = array();
  foreach ($result as $revision) {
    $revisions[$revision->vid] = $revision;
  }
  return $revisions;
}