Commit 5a703b7a by Qiang Xue

Further cleanup.

parent 50948423
...@@ -251,10 +251,10 @@ class ActiveQuery extends Query implements ActiveQueryInterface ...@@ -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;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment