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