You are here

function bat_type_revisioning_events_argument_current_revision in Booking and Availability Management Tools for Drupal 7

Evaluate revision argument.

1 string reference to 'bat_type_revisioning_events_argument_current_revision'
_bat_unit_rules_event_variables in modules/bat_unit/bat_unit.rules.inc
Returns event variables suitable for use with a type revision event.

File

modules/bat_unit/bat_unit.rules.inc, line 80

Code

function bat_type_revisioning_events_argument_current_revision($arguments, $name, $info) {
  if (empty($arguments['bat_type'])) {
    drupal_set_message(t('Revisioning: could not evaluate rule condition -- type variable missing.'), 'warning');
    return FALSE;
  }
  $type = $arguments['bat_type'];
  $current_vid = $type->current_revision_id;
  if ($type->revision_id != $current_vid) {
    $current = bat_type_load($type->type_id, $current_vid);
    return $current;
  }
  return $type;
}