You are here

function revisioning_get_number_of_archived_revisions in Revisioning 8

Same name and namespace in other branches
  1. 6.3 revisioning_api.inc \revisioning_get_number_of_archived_revisions()
  2. 7 revisioning_api.inc \revisioning_get_number_of_archived_revisions()

Get the number of archived revisions belonging to a node.

Parameters

object $node: the node object

Return value

int A count representing the number of archived revisions for the node Returns zero if there is only one (i.e. current) revision.

4 calls to revisioning_get_number_of_archived_revisions()
revisioning_delete_archived_action in ./revisioning_triggers_actions.inc
As declared in revisioning_action_info().
revisioning_delete_archived_confirm in ./revisioning.pages.inc
Return a confirmation page for deleting archived revisione.
revisioning_ux_page_alter in revisioning_ux/revisioning_ux.module
Implements hook_page_alter().
_revisioning_generate_node_links_according_to_permissions in ./revisioning_theme.inc
Get link operations.

File

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

Code

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