mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding fix for test in [4816].
This fixes hasOne association conditions git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4818 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
0fbcd7f9a4
commit
3ec4ecd127
1 changed files with 3 additions and 3 deletions
|
@ -975,7 +975,7 @@ class DboSource extends DataSource {
|
|||
case 'belongsTo':
|
||||
if ($external) {
|
||||
if ($type == 'hasOne') {
|
||||
$conditions = $this->__mergeConditions($queryData['conditions'], array("{$alias}.{$assocData['foreignKey']}" => '{$__cakeID__$}'));
|
||||
$conditions = $this->__mergeConditions($assocData['conditions'], array("{$alias}.{$assocData['foreignKey']}" => '{$__cakeID__$}'));
|
||||
} elseif ($type == 'belongsTo') {
|
||||
$conditions = $this->__mergeConditions($assocData['conditions'], array("{$alias}.{$linkModel->primaryKey}" => '{$__cakeForeignKey__$}'));
|
||||
}
|
||||
|
@ -992,9 +992,9 @@ class DboSource extends DataSource {
|
|||
}
|
||||
} else {
|
||||
if ($type == 'hasOne') {
|
||||
$conditions = $this->__mergeConditions($queryData['conditions'], array("{$alias}.{$assocData['foreignKey']}" => '{$__cakeIdentifier[' . "{$model->name}.{$model->primaryKey}" . ']__$}'));
|
||||
$conditions = $this->__mergeConditions($assocData['conditions'], array("{$alias}.{$assocData['foreignKey']}" => '{$__cakeIdentifier[' . "{$model->name}.{$model->primaryKey}" . ']__$}'));
|
||||
} elseif ($type == 'belongsTo') {
|
||||
$conditions = $this->__mergeConditions($assocData['conditions'], array($model->escapeField($assocData['foreignKey']) => '{$__cakeIdentifier[' . "{$alias}.{$linkModel->primaryKey}" . ']__$}'));
|
||||
$conditions = $this->__mergeConditions($assocData['conditions'], array("{$model->name}.{$assocData['foreignKey']}" => '{$__cakeIdentifier[' . "{$alias}.{$linkModel->primaryKey}" . ']__$}'));
|
||||
}
|
||||
|
||||
$join = array('table' => $this->fullTableName($linkModel),
|
||||
|
|
Loading…
Reference in a new issue