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
This commit is contained in:
nate 2007-08-17 13:37:56 +00:00
parent a5fd1561e8
commit 44e978c194

View file

@ -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);