[PR #950] [MERGED] Can cache empty collections #8946

Open
opened 2026-01-22 16:02:28 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/950
Author: @goetas
Created: 2/11/2014
Status: Merged
Merged: 2/12/2014
Merged by: @FabioBatSilva

Base: masterHead: patch-1


📝 Commits (5)

  • 1c94c16 Can cache empty collections
  • a5fbb20 Can cache many to many empty relations
  • 4a6d6e3 Test empty collections second level cache
  • 8cdbcf1 Merge remote-tracking branch 'origin/master' into patch-1
  • 94896ce Typo fix on many-to-many assocaition cascade test

📊 Changes

4 files changed (+69 additions, -8 deletions)

View changed files

📝 lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php (+2 -2)
📝 tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheAbstractTest.php (+5 -2)
📝 tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php (+30 -1)
📝 tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php (+32 -3)

📄 Description

I should be able to cache an "empty" collection.

I have a some objects, where 90% of these have on-to-many relations with zero associated elements.
This causes doctrine to run a query each time, instead of cache it as empty relation.

(same thing should be applied to many-to-many collections)


🔄 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/950 **Author:** [@goetas](https://github.com/goetas) **Created:** 2/11/2014 **Status:** ✅ Merged **Merged:** 2/12/2014 **Merged by:** [@FabioBatSilva](https://github.com/FabioBatSilva) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (5) - [`1c94c16`](https://github.com/doctrine/orm/commit/1c94c16234941903bb84d4745df0c51e43e25394) Can cache empty collections - [`a5fbb20`](https://github.com/doctrine/orm/commit/a5fbb20fbb58377fa876eb1ce8045541e0fbf01b) Can cache many to many empty relations - [`4a6d6e3`](https://github.com/doctrine/orm/commit/4a6d6e34f8a7a141f1c048a03e6b050ce5e8bfdc) Test empty collections second level cache - [`8cdbcf1`](https://github.com/doctrine/orm/commit/8cdbcf126370dcbaf5bba2ea8745a5afcd6e1c62) Merge remote-tracking branch 'origin/master' into patch-1 - [`94896ce`](https://github.com/doctrine/orm/commit/94896ce55255dc15f0d15d4ad2d545bcae5441dc) Typo fix on many-to-many assocaition cascade test ### 📊 Changes **4 files changed** (+69 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php` (+2 -2) 📝 `tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheAbstractTest.php` (+5 -2) 📝 `tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php` (+30 -1) 📝 `tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php` (+32 -3) </details> ### 📄 Description I should be able to cache an "empty" collection. I have a some objects, where 90% of these have on-to-many relations with zero associated elements. This causes doctrine to run a query each time, instead of cache it as empty relation. (same thing should be applied to many-to-many collections) --- <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 16:02:28 +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#8946