| @@ 65-76 (lines=12) @@ | ||
| 62 | /** |
|
| 63 | * Rollback transaction |
|
| 64 | */ |
|
| 65 | public function rollback() |
|
| 66 | { |
|
| 67 | if (true === $this->transactional) { |
|
| 68 | foreach ($this->watched as $table => $records) { |
|
| 69 | $this->performRollback($table, $records); |
|
| 70 | } |
|
| 71 | ||
| 72 | $this->transactionalLevel = 0; |
|
| 73 | $this->transactional = false; |
|
| 74 | $this->watched = array(); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * Commit transaction. |
|
| @@ 81-94 (lines=14) @@ | ||
| 78 | /** |
|
| 79 | * Commit transaction. |
|
| 80 | */ |
|
| 81 | public function commit() |
|
| 82 | { |
|
| 83 | if (true === $this->transactional) { |
|
| 84 | $this->transactionalLevel -= 1; |
|
| 85 | if (0 === $this->transactionalLevel) { |
|
| 86 | foreach ($this->watched as $table => $records) { |
|
| 87 | $this->performCommit($table, $records); |
|
| 88 | } |
|
| 89 | ||
| 90 | $this->transactional = false; |
|
| 91 | $this->watched = array(); |
|
| 92 | } |
|
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * @param string $table |
|