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) { switch ($type) {
case 'hasOne': case 'hasOne':
case 'belongsTo': case 'belongsTo':
$self = ($Model->name === $linkModel->name);
$conditions = $this->_mergeConditions( $conditions = $this->_mergeConditions(
$assocData['conditions'], $assocData['conditions'],
$this->getConstraint($type, $Model, $linkModel, $association, array_merge($assocData, compact('external', 'self'))) $this->getConstraint($type, $Model, $linkModel, $association, array_merge($assocData, compact('external', 'self')))
); );
$self = ($Model->name === $linkModel->name);
if (!$self && $external) { if (!$self && $external) {
$modelAlias = $Model->alias; $modelAlias = $Model->alias;
foreach ($conditions as $key => $condition) { foreach ($conditions as $key => $condition) {