| @@ 302-314 (lines=13) @@ | ||
| 299 | ||
| 300 | } |
|
| 301 | ||
| 302 | public function commit() { |
|
| 303 | ||
| 304 | if( !$this->isConnected() ) |
|
| 305 | throw new NotConnectedException(); |
|
| 306 | ||
| 307 | try { |
|
| 308 | return $this->pdo->commit(); |
|
| 309 | } |
|
| 310 | catch( \PDOException $e ) { |
|
| 311 | throw new TransactionException($e->getMessage(), $e->getCode(), $e); |
|
| 312 | } |
|
| 313 | ||
| 314 | } |
|
| 315 | ||
| 316 | public function rollback() { |
|
| 317 | ||
| @@ 316-328 (lines=13) @@ | ||
| 313 | ||
| 314 | } |
|
| 315 | ||
| 316 | public function rollback() { |
|
| 317 | ||
| 318 | if( !$this->isConnected() ) |
|
| 319 | throw new NotConnectedException(); |
|
| 320 | ||
| 321 | try { |
|
| 322 | return $this->pdo->rollBack(); |
|
| 323 | } |
|
| 324 | catch( \PDOException $e ) { |
|
| 325 | throw new TransactionException($e->getMessage(), $e->getCode(), $e); |
|
| 326 | } |
|
| 327 | ||
| 328 | } |
|
| 329 | ||
| 330 | public function inTransaction() { |
|
| 331 | return $this->isConnected() ? $this->pdo->inTransaction() : false; |
|