QueryDataReader::createItem() method should be removed
|
protected function createItem(array|object $row): array|object |
|
{ |
|
/** @psalm-var TValue */ |
|
return $row; |
|
} |
BatchQueryResult already has property Closure $populateMethod to prepare row result
https://github.com/yiisoft/db/blob/e380ae2ffb6f3a466e6f168fafa93548e50f0d8c/src/Query/BatchQueryResult.php#L109
Instead of these, Db\Query class can contain property Closure $callback (and withCallback() method) which will be called for each row from result.
The $callback will be specified in one place (Query) instead of many different realizations. And this will allow to use Query directly to get prepared result (without any data reader).
QueryDataReader::createItem()method should be removeddata-db/src/QueryDataReader.php
Lines 17 to 21 in 174652b
BatchQueryResultalready has propertyClosure $populateMethodto prepare row resulthttps://github.com/yiisoft/db/blob/e380ae2ffb6f3a466e6f168fafa93548e50f0d8c/src/Query/BatchQueryResult.php#L109
Instead of these,
Db\Queryclass can contain propertyClosure $callback(andwithCallback()method) which will be called for each row from result.The
$callbackwill be specified in one place (Query) instead of many different realizations. And this will allow to useQuerydirectly to get prepared result (without any data reader).