Browse Source

Further cleanup.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
5a703b7ae1
  1. 6
      framework/yii/db/ActiveQuery.php

6
framework/yii/db/ActiveQuery.php

@ -251,10 +251,10 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$this->with = []; $this->with = [];
foreach ($with as $name => $value) { foreach ($with as $name => $value) {
if (is_integer($name)) { if (is_integer($name)) {
if (!in_array($value, $this->with, true) && !isset($this->with[$value])) { // repeating relation is fine as ActiveQueryTrait::normalizeRelations() handle it well
$this->with[] = $value; $this->with[] = $value;
}
} elseif (!isset($this->with[$name])) { } elseif (!isset($this->with[$name])) {
// with() takes precedence over joinWith() when both specify the same relation with callback
$this->with[$name] = $value; $this->with[$name] = $value;
} }
} }

Loading…
Cancel
Save