[PR #86] [MERGED] Now findByOne really retrieve only one entity adding limit to query #7688

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

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/86
Author: @kwiateusz
Created: 7/21/2011
Status: Merged
Merged: 7/21/2011
Merged by: @guilhermeblanco

Base: masterHead: findByOne-patch


📝 Commits (2)

  • 0e6121e Now findByOne really retrieve only one entity adding limit to query
  • 570799b Restoring the missing comment

📊 Changes

2 files changed (+4 additions, -3 deletions)

View changed files

📝 lib/Doctrine/ORM/EntityRepository.php (+1 -1)
📝 lib/Doctrine/ORM/Persisters/BasicEntityPersister.php (+3 -2)

📄 Description

For me it's stupidity when doctrine make "select * from" query then in php return only one entity. Name of the function says' one! So why doctrine is torturing mysql (in my project it try to retrive ~300k records and then return only one...)


🔄 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/86 **Author:** [@kwiateusz](https://github.com/kwiateusz) **Created:** 7/21/2011 **Status:** ✅ Merged **Merged:** 7/21/2011 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `findByOne-patch` --- ### 📝 Commits (2) - [`0e6121e`](https://github.com/doctrine/orm/commit/0e6121e8f508097226ead3aace9ccc41ced2ca70) Now findByOne really retrieve only one entity adding limit to query - [`570799b`](https://github.com/doctrine/orm/commit/570799b48db72a762226897ace966a7f71f893dd) Restoring the missing comment ### 📊 Changes **2 files changed** (+4 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/EntityRepository.php` (+1 -1) 📝 `lib/Doctrine/ORM/Persisters/BasicEntityPersister.php` (+3 -2) </details> ### 📄 Description For me it's stupidity when doctrine make "select \* from" query then in php return only one entity. Name of the function says' one! So why doctrine is torturing mysql (in my project it try to retrive ~300k records and then return only one...) --- <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:22 +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#7688