[PR #54] [CLOSED] [DDC-217] Cache SQL results before hydration (and not after). #7647

Open
opened 2026-01-22 15:56:09 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/54
Author: @sobstel
Created: 5/11/2011
Status: Closed

Base: masterHead: 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:
f583625f79
There 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 c23b5a902d

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

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/54 **Author:** [@sobstel](https://github.com/sobstel) **Created:** 5/11/2011 **Status:** ❌ Closed **Base:** `master` ← **Head:** `DDC-217` --- ### 📝 Commits (1) - [`f583625`](https://github.com/doctrine/orm/commit/f583625f791da22dec77dd7d6c83b813f0bcbdaa) [DDC-217] Cache SQL results before hydration (and not after). ### 📊 Changes **6 files changed** (+103 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 Description I've made my own implementation for this: https://github.com/sobstel/doctrine2/commit/f583625f791da22dec77dd7d6c83b813f0bcbdaa There 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 https://github.com/dcousineau/doctrine2/commit/c23b5a902da79ffc472c0769b9258775baf3189e Whole discussion: http://www.doctrine-project.org/jira/browse/DDC-217 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 15:56:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7647