-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove LIMIT 1 for fetchOne #174
Conversation
setMaxResult(1) limits oneToMany/manyToMany associations.
I'm not entirely sure about this... I know this criples toMany relations, but shouldn't it be a bit smarter? This might be a BC Break for some people. Better would be to use the doctrine paginator tool to fetch only first row. |
Which makes this a duplicate of #118. |
Not really, since this is trying to solve it. |
In my opinion, fetchOne would be equivalent to getOneOrNullResult. |
@jasin755 I agree. But the problem is, what will it do, when I only remove the Now that I think about it, I've opened |
I would not see a problem in the exception. If used fetchOne and return to more rows the comrade made a mistake somewhere and can help him to reveal it (eg. by adding limit to query object) |
Are you going to merge with 3.0@dev ? |
I probably will. |
Remove LIMIT 1 for fetchOne
yep, it is a bc break :\ Any idea how to setup maxResults? I cannot override fetchOne because getQuery is private.. |
@matej21 what is your use case? do you wanna fetch one specific row, or just the first row from some result? |
@fprochazka I wanna fetch first row from the result |
It was stupid of me to merge this in a hurry. I'm reverting this 022976d and will tag |
setMaxResult(1) limits oneToMany/manyToMany associations.