diff options
-rw-r--r-- | framework/Data/DataGateway/TDataGatewayCommand.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/framework/Data/DataGateway/TDataGatewayCommand.php b/framework/Data/DataGateway/TDataGatewayCommand.php index 246c192b..d314ca05 100644 --- a/framework/Data/DataGateway/TDataGatewayCommand.php +++ b/framework/Data/DataGateway/TDataGatewayCommand.php @@ -160,6 +160,8 @@ class TDataGatewayCommand extends TComponent */ public function findByPk($keys) { + if($keys===null) + return null; list($where, $parameters) = $this->getPrimaryKeyCondition((array)$keys); $command = $this->getBuilder()->createFindCommand($where, $parameters); $this->onCreateCommand($command, new TSqlCriteria($where,$parameters)); @@ -196,6 +198,8 @@ class TDataGatewayCommand extends TComponent */ public function deleteByPk($keys) { + if(count($keys)==0) + return 0; $where = $this->getCompositeKeyCondition((array)$keys); $command = $this->getBuilder()->createDeleteCommand($where); $this->onCreateCommand($command, new TSqlCriteria($where,$keys)); |