| @@ 295-299 (lines=5) @@ | ||
| 292 | return $rows; |
|
| 293 | } |
|
| 294 | foreach ($rows as $row) { |
|
| 295 | if (is_string($this->indexBy)) { |
|
| 296 | $key = $row[$this->indexBy]; |
|
| 297 | } else { |
|
| 298 | $key = call_user_func($this->indexBy, $row); |
|
| 299 | } |
|
| 300 | $models[$key] = $row; |
|
| 301 | } |
|
| 302 | } else { |
|
| @@ 319-323 (lines=5) @@ | ||
| 316 | $modelClass = get_class($model); |
|
| 317 | $modelClass::populateRecord($model, $row); |
|
| 318 | $this->populateJoinedRelations($model, $row); |
|
| 319 | if (is_string($this->indexBy)) { |
|
| 320 | $key = $model->{$this->indexBy}; |
|
| 321 | } else { |
|
| 322 | $key = call_user_func($this->indexBy, $model); |
|
| 323 | } |
|
| 324 | $models[$key] = $model; |
|
| 325 | } |
|
| 326 | } |
|