summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Statements/TPreparedCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/SqlMap/Statements/TPreparedCommand.php')
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedCommand.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php
index 4ca41d73..06566a16 100644
--- a/framework/Data/SqlMap/Statements/TPreparedCommand.php
+++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php
@@ -47,10 +47,13 @@ class TPreparedCommand
{
$property = $statement->parameterMap()->getProperty($i);
$value = $statement->parameterMap()->getPropertyValue($registry,$property, $parameterObject);
- if($property->getDbType()=='')
+ $dbType = $property->getDbType();
+ if($dbType=='') //relies on PHP lax comparison
$command->bindValue($i+1,$value, TDbCommandBuilder::getPdoType($value));
- else
+ else if(strpos($dbType, 'PDO::')===0)
$command->bindValue($i+1,$value, constant($property->getDbType())); //assumes PDO types, e.g. PDO::PARAM_INT
+ else
+ $command->bindValue($i+1,$value);
}
}
}