Commit 35b54345 by Stephen Seliuk Committed by Qiang Xue

Handling $query->joinWith called inside of other $query->joinWith within Closure…

Handling $query->joinWith called inside of other $query->joinWith within Closure (called inside Closure). Ex.: ```php $query->joinWith( [ 'rel1' => function($query) { $query->joinWith( [ 'rel2' => function($query) { // ... } ] ); } ] ); ```
parent b8354224
......@@ -482,6 +482,9 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$relations[$fullName] = $relation = $primaryModel->getRelation($name);
if ($callback !== null) {
call_user_func($callback, $relation);
if(is_array($relation->joinWith)) {
$relation->buildJoinWith();
}
}
$this->joinWithRelation($parent, $relation, $this->getJoinType($joinType, $fullName));
}
......
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