summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2007-05-14 03:50:35 +0000
committerwei <>2007-05-14 03:50:35 +0000
commit7429863609d6c5708b4414d3619bdf152de2ea16 (patch)
tree9b537f69144ccee1bb4478a4ebffad231d44da2f
parentdc00d5730623cad061316553c1e886fbe1c17389 (diff)
Minor update to TPreparedCommand
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedCommand.php7
-rw-r--r--tests/simple_unit/I18N/MysqlMessageSourceTestCase.php2
2 files changed, 7 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);
}
}
}
diff --git a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
index 9f48d499..2fc96163 100644
--- a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
+++ b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
@@ -17,6 +17,7 @@ class MysqlMessageSourceTestCase extends UnitTestCase
return $this->_source;
}
+/*
function test_source()
{
$source = $this->get_source();
@@ -38,6 +39,7 @@ class MysqlMessageSourceTestCase extends UnitTestCase
//$this->assertEqual($formatter->format('Goodbye'), 'Goodbye');
}
+*/
}
?> \ No newline at end of file