Assign before actually using it.

This commit is contained in:
Ber Clausen 2013-11-12 01:13:55 -03:00
parent 026565033b
commit 67a65663a7

View file

@ -1606,13 +1606,13 @@ class DboSource extends DataSource {
switch ($type) {
case 'hasOne':
case 'belongsTo':
$self = ($Model->name === $linkModel->name);
$conditions = $this->_mergeConditions(
$assocData['conditions'],
$this->getConstraint($type, $Model, $linkModel, $association, array_merge($assocData, compact('external', 'self')))
);
$self = ($Model->name === $linkModel->name);
if (!$self && $external) {
$modelAlias = $Model->alias;
foreach ($conditions as $key => $condition) {