From 6009a471711416d2acd711592424005bf70228c8 Mon Sep 17 00:00:00 2001 From: Ivan Hontarenko Date: Thu, 23 Nov 2017 20:17:38 +0200 Subject: [PATCH] Update Parameter.php --- src/Colibri/Query/Expr/Parameter.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Colibri/Query/Expr/Parameter.php b/src/Colibri/Query/Expr/Parameter.php index 7d30810..ae32b96 100644 --- a/src/Colibri/Query/Expr/Parameter.php +++ b/src/Colibri/Query/Expr/Parameter.php @@ -68,7 +68,13 @@ public function setParameter($parameter) */ public function toSQL() { - return $this->escape($this->parameter, $this->parameterType); + switch ($this->parameterType) { + case Parameter::TYPE_NUMERIC: + case Parameter::TYPE_BOOLEAN: + return (integer)$this->parameter; + default: + return $this->escape($this->parameter, $this->parameterType); + } } /** @@ -84,4 +90,4 @@ public function __toString() } -} \ No newline at end of file +}