From f7f3d150ef35c026bf6aee72e78362e263419e1a Mon Sep 17 00:00:00 2001 From: knut <> Date: Wed, 6 Aug 2008 01:34:06 +0000 Subject: fixed #898 --- framework/Data/Common/TDbCommandBuilder.php | 4 ++-- framework/Data/DataGateway/TDataGatewayCommand.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'framework/Data') 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 @@ - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 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; } } - -?> + +?> -- cgit v1.2.3