From 18ea316c553f7ccfc18b73f0c987de007f11b275 Mon Sep 17 00:00:00 2001 From: wei <> Date: Mon, 4 Dec 2006 00:02:23 +0000 Subject: Fixed #469 --- .../Statements/TPreparedStatementFactory.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 framework/Data/SqlMap/Statements/TPreparedStatementFactory.php (limited to 'framework/Data/SqlMap/Statements/TPreparedStatementFactory.php') diff --git a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php new file mode 100644 index 00000000..52461983 --- /dev/null +++ b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php @@ -0,0 +1,32 @@ +_statement = $statement; + $this->_commandText = $sqlString; + } + + public function prepare() + { + $this->_preparedStatement = new TPreparedStatement(); + $this->_preparedStatement->setPreparedSql($this->_commandText); + if(!is_null($this->_statement->parameterMap())) + $this->createParametersForTextCommand(); + return $this->_preparedStatement; + } + + protected function createParametersForTextCommand() + { + foreach($this->_statement->ParameterMap()->getProperties() as $prop) + $this->_preparedStatement->getParameterNames()->add($prop->getProperty()); + } +} + +?> \ No newline at end of file -- cgit v1.2.3