add bool detection when inferring type
This commit is contained in:
parent
65fabc20c9
commit
7f8af83b5b
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user