-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
12 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ trait ActiveQueryTrait | |
*/ | ||
public $modelClass; | ||
/** | ||
* @var array list of relations that this query should be performed with | ||
* @var array a list of relations that this query should be performed with | ||
*/ | ||
public $with; | ||
/** | ||
|
@@ -143,10 +143,12 @@ private function createModels($rows) | |
} | ||
|
||
/** | ||
* @param ActiveRecord[] $models | ||
* @param array $with | ||
* Finds records corresponding to one or multiple relations and populates them into the primary models. | ||
* @param array $with a list of relations that this query should be performed with. Please | ||
* refer to [[with()]] for details about specifying this parameter. | ||
* @param ActiveRecord[] $models the primary models | ||
*/ | ||
private function populateRelations(&$models, $with) | ||
public function findWith($with, &$models) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
qiangxue
Author
Member
|
||
{ | ||
$primaryModel = new $this->modelClass; | ||
$relations = $this->normalizeRelations($primaryModel, $with); | ||
|
@@ -155,7 +157,7 @@ private function populateRelations(&$models, $with) | |
// inherit asArray from primary query | ||
$relation->asArray = $this->asArray; | ||
} | ||
$relation->findWith($name, $models); | ||
$relation->populateRelation($name, $models); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
should it become part of the interface then?