mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #54] [CLOSED] [DDC-217] Cache SQL results before hydration (and not after). #7647
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/54
Author: @sobstel
Created: 5/11/2011
Status: ❌ Closed
Base:
master← Head:DDC-217📝 Commits (1)
f583625[DDC-217] Cache SQL results before hydration (and not after).📊 Changes
6 files changed (+103 additions, -15 deletions)
View changed files
📝
lib/Doctrine/ORM/AbstractQuery.php(+12 -13)➕
lib/Doctrine/ORM/Internal/Hydration/CachedResultStatement.php(+19 -0)➕
lib/Doctrine/ORM/Internal/Hydration/ResultStatementDecorator.php(+38 -0)➕
lib/Doctrine/ORM/Internal/Hydration/ResultStatementInterface.php(+10 -0)📝
lib/Doctrine/ORM/NativeQuery.php(+12 -0)📝
lib/Doctrine/ORM/Query.php(+12 -2)📄 Description
I've made my own implementation for this:
f583625f79There are no changes in specific hydrators and there is no fetchAll(). I've added 2 wrappers: one for cached result array, and one for uncached pdo statement. The former (CachedResultStatement) is actually ArrayIterator which just implements used methods (fetch & closeCursor => also specified in ResultStatementInterface). The latter is decorator for stmt, which just collects results on each call of fetch() (results are later available by calling getResult), and apart from this all calls are delegated to actual stmt object.
I've used (copied) following changes from Daniel
c23b5a902dWhole discussion: http://www.doctrine-project.org/jira/browse/DDC-217
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.