From 7f8af83b5be1ca5fdd66a5be63b6977b107e65b0 Mon Sep 17 00:00:00 2001 From: Klein Florian Date: Wed, 10 Oct 2012 11:20:41 +0200 Subject: [PATCH] add bool detection when inferring type --- lib/Doctrine/ORM/Query/ParameterTypeInferer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php index 45a0aab08..0c4df55ee 100644 --- a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php +++ b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php @@ -25,7 +25,7 @@ use Doctrine\DBAL\Types\Type; /** * Provides an enclosed support for parameter infering. * - * + * * @link www.doctrine-project.org * @since 2.0 * @author Benjamin Eberlei @@ -50,6 +50,10 @@ class ParameterTypeInferer return Type::INTEGER; } + if (is_bool($value)) { + return Type::BOOLEAN; + } + if ($value instanceof \DateTime) { return Type::DATETIME; } @@ -62,4 +66,4 @@ class ParameterTypeInferer return \PDO::PARAM_STR; } -} \ No newline at end of file +}