add bool detection when inferring type
This commit is contained in:
parent
65fabc20c9
commit
7f8af83b5b
1 changed files with 6 additions and 2 deletions
|
@ -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 <kontakt@beberlei.de>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue