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.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php
index 7bb68c79..ff5fd6ff 100644
--- a/framework/Data/SqlMap/Statements/TPreparedCommand.php
+++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php
@@ -10,6 +10,8 @@
* @package System.Data.SqlMap.Statements
*/
+Prado::using('System.Data.Common.TDbMetaData');
+
/**
* TPreparedCommand class.
*
@@ -20,11 +22,17 @@
*/
class TPreparedCommand
{
- public function create(TSqlMapManager $manager, $connection, $statement, $parameterObject)
+ public function create(TSqlMapManager $manager, $connection, $statement, $parameterObject,$skip=null,$max=null)
{
$prepared = $statement->getSQLText()->getPreparedStatement($parameterObject);
$connection->setActive(true);
- $command = $connection->createCommand($prepared->getPreparedSql());
+ $sql = $prepared->getPreparedSql();
+ if($max!==null || $skip!==null)
+ {
+ $builder = TDbMetaData::getInstance($connection)->createCommandBuilder();
+ $sql = $builder->applyLimitOffset($sql,$max,$skip);
+ }
+ $command = $connection->createCommand($sql);
$this->applyParameterMap($manager, $command, $prepared, $statement, $parameterObject);
return $command;
}