Skip to content

QueryDataReader::createItem() shold be realized in Db\Query class #50

@Tigrov

Description

@Tigrov

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions