[PR #1032] [MERGED] Add support for optimized contains in LazyCriteria #9061

Closed
opened 2026-01-22 16:03:01 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/1032
Author: @bakura10
Created: 5/17/2014
Status: Merged
Merged: 6/21/2014
Merged by: @guilhermeblanco

Base: masterHead: optimized-contains


📝 Commits (7)

📊 Changes

9 files changed (+77 additions, -24 deletions)

View changed files

📝 UPGRADE.md (+5 -5)
📝 lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php (+2 -2)
📝 lib/Doctrine/ORM/LazyCriteriaCollection.php (+16 -1)
📝 lib/Doctrine/ORM/Persisters/BasicEntityPersister.php (+10 -7)
📝 lib/Doctrine/ORM/Persisters/EntityPersister.php (+3 -3)
📝 lib/Doctrine/ORM/Persisters/OneToManyPersister.php (+4 -3)
📝 tests/Doctrine/Tests/Mocks/EntityPersisterMock.php (+2 -1)
📝 tests/Doctrine/Tests/ORM/Cache/Persister/AbstractEntityPersisterTest.php (+2 -2)
📝 tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php (+33 -0)

📄 Description

Hi,

This continue my work on the LazyCriteria and include a support for optimized contains that does not initialize the full collection when checking if a record exists in a collection.

Please note that I had to modify the exists method signature in EntityInterface. I'm not sure this is a problem because, as @ocramius said in the ManyToMany thread, custom persisters is not supported. However, I added a small note to be sure ;).


🔄 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/1032 **Author:** [@bakura10](https://github.com/bakura10) **Created:** 5/17/2014 **Status:** ✅ Merged **Merged:** 6/21/2014 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `optimized-contains` --- ### 📝 Commits (7) - [`a04113f`](https://github.com/doctrine/orm/commit/a04113f4101797e4b7552e874d126b2e011692cd) Add support for optimized contains - [`f52a512`](https://github.com/doctrine/orm/commit/f52a512c592299815179fb8c744d71ef28b99c96) Add UPGRADE note - [`239b862`](https://github.com/doctrine/orm/commit/239b862665a50cd65234e67ffb54497009a61b6a) Add missing typehint - [`ddfc951`](https://github.com/doctrine/orm/commit/ddfc951a0ea1aaf8bd92d946f58a6c908452325e) Remove useless docblock - [`8a8c6ea`](https://github.com/doctrine/orm/commit/8a8c6ea3a61159b1e38f697ff06d4243a5bc2900) Remove extra phpdoc - [`9d7d731`](https://github.com/doctrine/orm/commit/9d7d73109012774c5deabca7ce61aad5fe074094) Remove BC notice - [`140dc92`](https://github.com/doctrine/orm/commit/140dc92e5f4fa30ac23f941a9b9a09986f91790b) Enforce Criteria ### 📊 Changes **9 files changed** (+77 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `UPGRADE.md` (+5 -5) 📝 `lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php` (+2 -2) 📝 `lib/Doctrine/ORM/LazyCriteriaCollection.php` (+16 -1) 📝 `lib/Doctrine/ORM/Persisters/BasicEntityPersister.php` (+10 -7) 📝 `lib/Doctrine/ORM/Persisters/EntityPersister.php` (+3 -3) 📝 `lib/Doctrine/ORM/Persisters/OneToManyPersister.php` (+4 -3) 📝 `tests/Doctrine/Tests/Mocks/EntityPersisterMock.php` (+2 -1) 📝 `tests/Doctrine/Tests/ORM/Cache/Persister/AbstractEntityPersisterTest.php` (+2 -2) 📝 `tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php` (+33 -0) </details> ### 📄 Description Hi, This continue my work on the LazyCriteria and include a support for optimized contains that does not initialize the full collection when checking if a record exists in a collection. Please note that I had to modify the exists method signature in EntityInterface. I'm not sure this is a problem because, as @ocramius said in the ManyToMany thread, custom persisters is not supported. However, I added a small note to be sure ;). --- <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:03:01 +01:00
admin closed this issue 2026-01-22 16:03:02 +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#9061