Skip to content

Commit

Permalink
Bringing back some old code removed for hhvm, we do need it
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 20, 2014
1 parent af13707 commit 6aad188
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Database/Driver/PDODriverTrait.php
Expand Up @@ -93,6 +93,9 @@ public function prepare($query) {
*/
public function beginTransaction() {
$this->connect();
if ($this->_connection->inTransaction()) {
return true;
}
return $this->_connection->beginTransaction();
}

Expand All @@ -103,6 +106,9 @@ public function beginTransaction() {
*/
public function commitTransaction() {
$this->connect();
if (!$this->_connection->inTransaction()) {
return false;
}
return $this->_connection->commit();
}

Expand All @@ -112,6 +118,9 @@ public function commitTransaction() {
* @return boolean true on success, false otherwise
*/
public function rollbackTransaction() {
if (!$this->_connection->inTransaction()) {
return false;
}
return $this->_connection->rollback();
}

Expand Down

0 comments on commit 6aad188

Please sign in to comment.