mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
More replacements of assignation by reference
This commit is contained in:
parent
122cb1ec5b
commit
28685dc234
1 changed files with 12 additions and 12 deletions
|
@ -645,7 +645,7 @@ class DboSource extends DataSource {
|
|||
if (PHP_SAPI != 'cli') {
|
||||
App::import('Core', 'View');
|
||||
$controller = null;
|
||||
$View =& new View($controller, false);
|
||||
$View = new View($controller, false);
|
||||
$View->set('logs', array($this->configKeyName => $log));
|
||||
echo $View->element('sql_dump', array('_forced_from_dbo_' => true));
|
||||
} else {
|
||||
|
@ -817,7 +817,7 @@ class DboSource extends DataSource {
|
|||
|
||||
foreach ($_associations as $type) {
|
||||
foreach ($model->{$type} as $assoc => $assocData) {
|
||||
$linkModel =& $model->{$assoc};
|
||||
$linkModel = $model->{$assoc};
|
||||
$external = isset($assocData['external']);
|
||||
|
||||
if ($model->useDbConfig == $linkModel->useDbConfig) {
|
||||
|
@ -842,16 +842,16 @@ class DboSource extends DataSource {
|
|||
if ($model->recursive > -1) {
|
||||
foreach ($_associations as $type) {
|
||||
foreach ($model->{$type} as $assoc => $assocData) {
|
||||
$linkModel =& $model->{$assoc};
|
||||
$linkModel = $model->{$assoc};
|
||||
|
||||
if (empty($linkedModels[$type . '/' . $assoc])) {
|
||||
if ($model->useDbConfig == $linkModel->useDbConfig) {
|
||||
$db =& $this;
|
||||
$db = $this;
|
||||
} else {
|
||||
$db =& ConnectionManager::getDataSource($linkModel->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($linkModel->useDbConfig);
|
||||
}
|
||||
} elseif ($model->recursive > 1 && ($type == 'belongsTo' || $type == 'hasOne')) {
|
||||
$db =& $this;
|
||||
$db = $this;
|
||||
}
|
||||
|
||||
if (isset($db) && method_exists($db, 'queryAssociation')) {
|
||||
|
@ -957,14 +957,14 @@ class DboSource extends DataSource {
|
|||
if ($recursive > 0) {
|
||||
foreach ($linkModel->associations() as $type1) {
|
||||
foreach ($linkModel->{$type1} as $assoc1 => $assocData1) {
|
||||
$deepModel =& $linkModel->{$assoc1};
|
||||
$deepModel = $linkModel->{$assoc1};
|
||||
$tmpStack = $stack;
|
||||
$tmpStack[] = $assoc1;
|
||||
|
||||
if ($linkModel->useDbConfig === $deepModel->useDbConfig) {
|
||||
$db =& $this;
|
||||
$db = $this;
|
||||
} else {
|
||||
$db =& ConnectionManager::getDataSource($deepModel->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($deepModel->useDbConfig);
|
||||
}
|
||||
$db->queryAssociation($linkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack);
|
||||
}
|
||||
|
@ -1026,15 +1026,15 @@ class DboSource extends DataSource {
|
|||
if ($recursive > 0) {
|
||||
foreach ($linkModel->associations() as $type1) {
|
||||
foreach ($linkModel->{$type1} as $assoc1 => $assocData1) {
|
||||
$deepModel =& $linkModel->{$assoc1};
|
||||
$deepModel = $linkModel->{$assoc1};
|
||||
|
||||
if (($type1 === 'belongsTo') || ($deepModel->alias === $model->alias && $type === 'belongsTo') || ($deepModel->alias != $model->alias)) {
|
||||
$tmpStack = $stack;
|
||||
$tmpStack[] = $assoc1;
|
||||
if ($linkModel->useDbConfig == $deepModel->useDbConfig) {
|
||||
$db =& $this;
|
||||
$db = $this;
|
||||
} else {
|
||||
$db =& ConnectionManager::getDataSource($deepModel->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($deepModel->useDbConfig);
|
||||
}
|
||||
$db->queryAssociation($linkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue