summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
authorctrlaltca <ctrlaltca@gmail.com>2016-02-11 11:33:43 +0100
committerctrlaltca <ctrlaltca@gmail.com>2016-02-11 11:33:43 +0100
commit52f3d7b084f5f066f10c1691833383ebe924f588 (patch)
tree4d768b2367dd9dfda5e7fbe2ac1d8b151e0cedb8 /framework/Data
parent4db58d8d7cdbf56f32c5644f90c7294c7ad0002d (diff)
parentcc9252cc2ac9f6972c039dd74cbe47c379727d71 (diff)
Merge pull request #565 from majuca/master
Issue #559, add support for memcached
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/DataGateway/TDataGatewayCommand.php4
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));