summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/Common/TDbCommandBuilder.php4
-rw-r--r--framework/Data/DataGateway/TDataGatewayCommand.php12
2 files changed, 8 insertions, 8 deletions
diff --git a/framework/Data/Common/TDbCommandBuilder.php b/framework/Data/Common/TDbCommandBuilder.php
index c4bfeb98..155a62f8 100644
--- a/framework/Data/Common/TDbCommandBuilder.php
+++ b/framework/Data/Common/TDbCommandBuilder.php
@@ -90,8 +90,8 @@ class TDbCommandBuilder extends TComponent
*/
public function applyLimitOffset($sql, $limit=-1, $offset=-1)
{
- $limit = $limit!==null ? intval($limit) : -1;
- $offset = $offset!==null ? intval($offset) : -1;
+ $limit = $limit!==null ? (int)$limit : -1;
+ $offset = $offset!==null ? (int)$offset : -1;
$limitStr = $limit >= 0 ? ' LIMIT '.$limit : '';
$offsetStr = $offset >= 0 ? ' OFFSET '.$offset : '';
return $sql.$limitStr.$offsetStr;
diff --git a/framework/Data/DataGateway/TDataGatewayCommand.php b/framework/Data/DataGateway/TDataGatewayCommand.php
index 8145ae9d..35e4dcbe 100644
--- a/framework/Data/DataGateway/TDataGatewayCommand.php
+++ b/framework/Data/DataGateway/TDataGatewayCommand.php
@@ -1,10 +1,10 @@
-<?php
+<?php
/**
* TDataGatewayCommand, TDataGatewayEventParameter and TDataGatewayResultEventParameter class file.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.DataGateway
@@ -331,7 +331,7 @@ class TDataGatewayCommand extends TComponent
public function count($criteria)
{
if($criteria===null)
- return intval($this->getBuilder()->createCountCommand()->queryScalar());
+ return (int)$this->getBuilder()->createCountCommand()->queryScalar();
$where = $criteria->getCondition();
$parameters = $criteria->getParameters()->toArray();
$ordering = $criteria->getOrdersBy();
@@ -339,7 +339,7 @@ class TDataGatewayCommand extends TComponent
$offset = $criteria->getOffset();
$command = $this->getBuilder()->createCountCommand($where,$parameters,$ordering,$limit,$offset);
$this->onCreateCommand($command, $criteria);
- return $this->onExecuteCommand($command, intval($command->queryScalar()));
+ return $this->onExecuteCommand($command, (int)$command->queryScalar());
}
/**
@@ -536,5 +536,5 @@ class TDataGatewayResultEventParameter extends TEventParameter
$this->_result=$value;
}
}
-
-?>
+
+?>