1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

Merge pull request #467 from docteurklein/fix-bool-type-binding

add bool detection when inferring type
This commit is contained in:
Guilherme Blanco 2012-10-21 18:39:29 -07:00
commit 38d8c7f0d9

View file

@ -25,7 +25,7 @@ use Doctrine\DBAL\Types\Type;
/** /**
* Provides an enclosed support for parameter infering. * Provides an enclosed support for parameter infering.
* *
* *
* @link www.doctrine-project.org * @link www.doctrine-project.org
* @since 2.0 * @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de> * @author Benjamin Eberlei <kontakt@beberlei.de>
@ -50,6 +50,10 @@ class ParameterTypeInferer
return Type::INTEGER; return Type::INTEGER;
} }
if (is_bool($value)) {
return Type::BOOLEAN;
}
if ($value instanceof \DateTime) { if ($value instanceof \DateTime) {
return Type::DATETIME; return Type::DATETIME;
} }
@ -62,4 +66,4 @@ class ParameterTypeInferer
return \PDO::PARAM_STR; return \PDO::PARAM_STR;
} }
} }