function civicrm_api3_logging_revert($params) {
$schema = new CRM_Logging_Schema();
$reverter = new CRM_Logging_Reverter($params['log_conn_id'], CRM_Utils_Array::value('log_date', $params));
- $reverter->calculateDiffsFromLogConnAndDate($schema->getLogTablesForContact());
+ $tables = !empty($params['tables']) ? (array) $params['tables'] : $schema->getLogTablesForContact();
+ $reverter->calculateDiffsFromLogConnAndDate($tables);
$reverter->revert();
return civicrm_api3_create_success(1);
}
'api.default' => '10 SECOND',
'description' => ts('Used when log_date is passed in'),
);
+
+ $params['tables'] = array(
+ 'title' => ts('Tables to revert'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'description' => ts('Tables to revert, if not set all contact-referring entities will be reverted'),
+ );
}
/**
$schema = new CRM_Logging_Schema();
$interval = (empty($params['log_date'])) ? NULL : $params['interval'];
$differ = new CRM_Logging_Differ($params['log_conn_id'], CRM_Utils_Array::value('log_date', $params), $interval);
- return civicrm_api3_create_success($differ->getAllChangesForConnection($schema->getLogTablesForContact()));
+ $tables = !empty($params['tables']) ? (array) $params['tables'] : $schema->getLogTablesForContact();
+ return civicrm_api3_create_success($differ->getAllChangesForConnection($tables));
}
/**
'api.default' => '10 SECOND',
'description' => ts('Used when log_date is passed in'),
);
+ $params['tables'] = array(
+ 'title' => ts('Tables to query'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'description' => ts('Tables to query, if not set all contact-referring entities will be queried'),
+ );
}