From 44e978c194cc2afeb3e4c46c2a94ae171371e20c Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 17 Aug 2007 13:37:56 +0000 Subject: [PATCH] Fixing hasMany SQL optimization (Ticket #3075) git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5541 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index e7a1de9d5..ce47fe680 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -711,7 +711,7 @@ class DboSource extends DataSource { return null; } $count = count($resultSet); - if ($type === 'hasMany' && !isset($assocData['limit'])) { + if ($type === 'hasMany' && (!isset($assocData['limit']) || empty($assocData['limit']))) { $ins = array(); for ($i = 0; $i < $count; $i++) { $in = $this->insertQueryData('{$__cakeID__$}', $resultSet[$i], $association, $assocData, $model, $linkModel, $stack);