Commit 30ca3a42 authored by Valentinas Bartusevičius's avatar Valentinas Bartusevičius

Merge branch 'master' of https://github.com/v-bartusevicius/dbal into DateIntervalType

parents 6c319742 eae7b0d8
......@@ -3,7 +3,6 @@ logs/
reports/
dist/
download/
lib/Doctrine/Common/
vendor/
*.phpunit.xml
composer.lock
\ No newline at end of file
......@@ -1093,7 +1093,7 @@ class Connection implements DriverConnection
*
* @param \Closure $func The function to execute transactionally.
*
* @return void
* @return mixed The value returned by $func
*
* @throws \Exception
*/
......@@ -1101,8 +1101,9 @@ class Connection implements DriverConnection
{
$this->beginTransaction();
try {
$func($this);
$res = $func($this);
$this->commit();
return $res;
} catch (Exception $e) {
$this->rollBack();
throw $e;
......@@ -1590,7 +1591,7 @@ class Connection implements DriverConnection
}
try {
$this->query($this->platform->getDummySelectSQL());
$this->query($this->getDatabasePlatform()->getDummySelectSQL());
return true;
} catch (DBALException $e) {
......
Subproject commit 4200b4bc95ae3c1b03d943cd875277e35a17898a
Subproject commit efa94de25beef4aefaeb7972c122798f9876fc39
Subproject commit d1c7d4334e38cad603a5c863d4c7b91bb04ec6b2
......@@ -209,6 +209,14 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
});
}
public function testTransactionalReturnValue()
{
$res = $this->_conn->transactional(function($conn) {
return 42;
});
$this->assertEquals(42, $res);
}
/**
* Tests that the quote function accepts DBAL and PDO types.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment