<?php
use Doctrine\DBAL\Connection;
/* @var $connection Doctrine\DBAL\Connection */
$function = function (Connection $conn) {
$conn->insert('test', [
'id' => '3',
'name' => 'bar',
'creation_date' => '2014-07-23 07:27:18',
]);
};
$connection->transactional($function);
$sql = 'SELECT * FROM test WHERE id = ?';
$result = $connection->executeQuery($sql, [3])
->fetchAll();
dump($result);
^ array:1 [
0 => array:3 [
"id" => 3
"name" => "bar"
"creation_date" => "2014-07-23 07:27:18"
]
]