| @@ 1470-1482 (lines=13) @@ | ||
| 1467 | * |
|
| 1468 | * @return bool <p>Boolean true on success, false otherwise.</p> |
|
| 1469 | */ |
|
| 1470 | public function rollback() |
|
| 1471 | { |
|
| 1472 | if ($this->_in_transaction === false) { |
|
| 1473 | $this->_debug->displayError('Error: mysql server is not in transaction!', false); |
|
| 1474 | return false; |
|
| 1475 | } |
|
| 1476 | ||
| 1477 | $return = \mysqli_rollback($this->link); |
|
| 1478 | \mysqli_autocommit($this->link, true); |
|
| 1479 | $this->_in_transaction = false; |
|
| 1480 | ||
| 1481 | return $return; |
|
| 1482 | } |
|
| 1483 | ||
| 1484 | ||
| 1485 | /** |
|
| @@ 1490-1502 (lines=13) @@ | ||
| 1487 | * |
|
| 1488 | * @return bool <p>Boolean true on success, false otherwise.</p> |
|
| 1489 | */ |
|
| 1490 | public function commit() |
|
| 1491 | { |
|
| 1492 | if ($this->_in_transaction === false) { |
|
| 1493 | $this->_debug->displayError('Error: mysql server is not in transaction!', false); |
|
| 1494 | return false; |
|
| 1495 | } |
|
| 1496 | ||
| 1497 | $return = mysqli_commit($this->link); |
|
| 1498 | \mysqli_autocommit($this->link, true); |
|
| 1499 | $this->_in_transaction = false; |
|
| 1500 | ||
| 1501 | return $return; |
|
| 1502 | } |
|
| 1503 | ||
| 1504 | /** |
|
| 1505 | * Execute a callback inside a transaction. |
|