You are here

function bat_type_diff_get_next_vid in Booking and Availability Management Tools for Drupal 7

Get the entry in the revisions list after $vid.

Parameters

array $type_revisions: Array of type revision IDs in descending order.

int $vid: Version ID to look for.

Return value

bool|int Returns FALSE if $vid is the last entry.

1 call to bat_type_diff_get_next_vid()
bat_type_compare_revisions in modules/bat_unit/bat_type.diff.inc
Create a comparison for the type between versions 'old_revision_id' and 'new_revision_id'.

File

modules/bat_unit/bat_type.diff.inc, line 114

Code

function bat_type_diff_get_next_vid($type_revisions, $vid) {
  $previous = NULL;
  foreach ($type_revisions as $revision) {
    if ($revision->revision_id == $vid) {
      return $previous ? $previous->revision_id : FALSE;
    }
    $previous = $revision;
  }
  return FALSE;
}