[DDC-1241] Additional parameters for EntityRepository::findAll() and EntityRepository::findOneBy() Created: 01/Jul/11 Updated: 09/Nov/12 Resolved: 06/Nov/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1 |
| Fix Version/s: | 2.3.1 |
| Security Level: | All |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Jasper N. Brouwer | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Description |
|
In the Doctrine 2.1 versions the method EntityRepository::findBy() accepts additional parameters for ordering, limit and offset. It would be nice for the method EntityRepository::findOneBy() to accept an additional parameter for ordering as well. It could use the following signature: And maybe update EntityRepository::findAll() as well with the signature: Looking forward to your thoughts. |
| Comments |
| Comment by Dieter Provoost [ 27/Jul/11 ] |
|
I can't seem to find the implementation of this even though this issue has been resolved. Is this possible? |
| Comment by Benjamin Eberlei [ 27/Jul/11 ] |
|
It was only added to "findBy" |
| Comment by Jasper N. Brouwer [ 27/Jul/11 ] |
|
So the resolution is actually a "won't fix" (in stead of "fixed")? I know this was added to "findBy", but my request was to extend the "findOneBy" and "findAll" as well... |
| Comment by Dieter Provoost [ 27/Jul/11 ] |
|
Can it also be added to "findOneBy"? It would come in very handy for the use case above (for example: finding the newest blog-post). |
| Comment by Benjamin Eberlei [ 27/Jul/11 ] |
|
Reopened for 2.2 with implementation for "findOneby()" |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
| Comment by Paweł Nowak [ 05/Nov/12 ] |
|
A proposed implementation of findOneBy with ordering is available with the following pull request: https://github.com/doctrine/doctrine2/pull/504. |
| Comment by Fabio B. Silva [ 06/Nov/12 ] |
|
Fixed : https://github.com/doctrine/doctrine2/commit/283ed55824b7c713611e4b1e336551be805c48b5 |