diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index f6891c9bc8a..3efeea9ea39 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -42,6 +42,10 @@ class Statement implements \IteratorAggregate, DriverStatement * @var array The bound parameters. */ protected $params = array(); + /** + * @var array The parameter types + */ + protected $types = array(); /** * @var \Doctrine\DBAL\Driver\Statement The underlying driver statement. */ @@ -85,6 +89,7 @@ public function __construct($sql, Connection $conn) public function bindValue($name, $value, $type = null) { $this->params[$name] = $value; + $this->types[$name] = $type; if ($type !== null) { if (is_string($type)) { $type = Type::getType($type); @@ -126,7 +131,7 @@ public function execute($params = null) { $logger = $this->conn->getConfiguration()->getSQLLogger(); if ($logger) { - $logger->startQuery($this->sql, $this->params); + $logger->startQuery($this->sql, $this->params, $this->types); } $stmt = $this->stmt->execute($params); @@ -135,6 +140,7 @@ public function execute($params = null) $logger->stopQuery(); } $this->params = array(); + $this->types = array(); return $stmt; }