public function trans_begin($test_mode = FALSE)
{
if (!$this->trans_enabled) {
return FALSE;
} elseif ($this->_trans_depth > 0) {
$this->_trans_depth++;
return TRUE;
}
// Reset the transaction failure flag.
// If the $test_mode flag is set to TRUE transactions will be rolled back
// even if the queries produce a successful result.
$this->_trans_failure = $test_mode === TRUE;
if ($this->_trans_begin()) {
$this->_trans_depth++;
return TRUE;
}
return FALSE;
}