summaryrefslogtreecommitdiff
path: root/framework/DataAccess/SQLMap/Statements/TSimpleDynamicSql.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/DataAccess/SQLMap/Statements/TSimpleDynamicSql.php')
-rw-r--r--framework/DataAccess/SQLMap/Statements/TSimpleDynamicSql.php32
1 files changed, 0 insertions, 32 deletions
diff --git a/framework/DataAccess/SQLMap/Statements/TSimpleDynamicSql.php b/framework/DataAccess/SQLMap/Statements/TSimpleDynamicSql.php
deleted file mode 100644
index 1230b4f7..00000000
--- a/framework/DataAccess/SQLMap/Statements/TSimpleDynamicSql.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-class TSimpleDynamicSql extends TStaticSql
-{
- private $_mappings=array();
-
- public function __construct($mappings)
- {
- $this->_mappings = $mappings;
- }
-
- public function getPreparedStatement($parameter=null)
- {
- $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);
- }
-}
-
-?> \ No newline at end of file