You are here

function bat_type_get_number_of_revisions_newer_than in Booking and Availability Management Tools for Drupal 7

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

Parameters

int $revision_id: The reference revision_id.

int $type_id: The id of the type.

Return value

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

2 calls to bat_type_get_number_of_revisions_newer_than()
bat_type_edit_form in modules/bat_unit/bat_type.admin.inc
Form callback: create or edit a type.
bat_type_title_callback in modules/bat_unit/bat_unit.module
Callback for the type View and Edit titles.

File

modules/bat_unit/bat_unit.module, line 576

Code

function bat_type_get_number_of_revisions_newer_than($revision_id, $type_id) {
  $revision_count = db_query("SELECT COUNT(revision_id) FROM {bat_types_revision} WHERE type_id = :type_id AND revision_id > :revision_id", array(
    ':revision_id' => $revision_id,
    ':type_id' => $type_id,
  ))
    ->fetchField();
  return $revision_count;
}