@@ 1100-1104 (lines=5) @@ | ||
1097 | $linkModel = $model->{$assoc}; |
|
1098 | ||
1099 | if (!isset($linkedModels[$type . '/' . $assoc])) { |
|
1100 | if ($model->useDbConfig === $linkModel->useDbConfig) { |
|
1101 | $db = $this; |
|
1102 | } else { |
|
1103 | $db = ConnectionManager::getDataSource($linkModel->useDbConfig); |
|
1104 | } |
|
1105 | } elseif ($model->recursive > 1 && ($type === 'belongsTo' || $type === 'hasOne')) { |
|
1106 | $db = $this; |
|
1107 | } |
|
@@ 1212-1216 (lines=5) @@ | ||
1209 | $tmpStack = $stack; |
|
1210 | $tmpStack[] = $assoc1; |
|
1211 | ||
1212 | if ($linkModel->useDbConfig === $deepModel->useDbConfig) { |
|
1213 | $db = $this; |
|
1214 | } else { |
|
1215 | $db = ConnectionManager::getDataSource($deepModel->useDbConfig); |
|
1216 | } |
|
1217 | $db->queryAssociation($linkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack); |
|
1218 | } |
|
1219 | } |
|
@@ 1286-1290 (lines=5) @@ | ||
1283 | if ($type1 === 'belongsTo' || ($deepModel->alias === $modelAlias && $type === 'belongsTo') || ($deepModel->alias !== $modelAlias)) { |
|
1284 | $tmpStack = $stack; |
|
1285 | $tmpStack[] = $assoc1; |
|
1286 | if ($linkModel->useDbConfig === $deepModel->useDbConfig) { |
|
1287 | $db = $this; |
|
1288 | } else { |
|
1289 | $db = ConnectionManager::getDataSource($deepModel->useDbConfig); |
|
1290 | } |
|
1291 | $db->queryAssociation($linkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack); |
|
1292 | } |
|
1293 | } |