summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/SqlMap/Statements/TSimpleDynamicSql.php')
-rw-r--r--framework/Data/SqlMap/Statements/TSimpleDynamicSql.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
index 910fd659..3e8969ba 100644
--- a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
+++ b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
@@ -27,23 +27,15 @@ class TSimpleDynamicSql extends TStaticSql
$this->_mappings = $mappings;
}
- public function getPreparedStatement($parameter=null)
+ public function replaceDynamicParameter($sql, $parameter)
{
- $statement = parent::getPreparedStatement($parameter);
- if($parameter !== null)
- $this->mapDynamicParameter($statement, $parameter);
- return $statement;
- }
-
- protected function mapDynamicParameter($statement, $parameter)
- {
- $sql = $statement->getPreparedSql();
foreach($this->_mappings as $property)
{
$value = TPropertyAccess::get($parameter, $property);
$sql = preg_replace('/'.TSimpleDynamicParser::DYNAMIC_TOKEN.'/', $value, $sql, 1);
}
- $statement->setPreparedSql($sql);
+
+ return $sql;
}
}