Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions common/persistence/class.SqlPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,18 @@ public function quote($parameter, $parameter_type = PDO::PARAM_STR){
public function lastInsertId($name = null){
return $this->getDriver()->lastInsertId($name);
}

/**
* Execute a function within a transaction.
*
* @param Closure $func The function to execute transactionally.
*
* @return mixed The value returned by $func
*
* @throws Throwable
*/
public function transactional(Closure $func)
{
return $this->getDriver()->transactional($func);
}
}
15 changes: 15 additions & 0 deletions common/persistence/sql/dbal/class.Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,19 @@ public function getDataBase()
{
return $this->connection->getDatabase();
}

/**
* Execute a function within a transaction.
*
* @param Closure $func The function to execute transactionally.
*
* @return mixed The value returned by $func
*
* @throws Exception
* @throws Throwable
*/
public function transactional(Closure $func)
{
return $this->connection->transactional($func);
}
}