You are here

function bat_type_diff_get_previous_vid in Booking and Availability Management Tools for Drupal 7

Get the entry in the revision list before $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 first entry.

1 call to bat_type_diff_get_previous_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 136

Code

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