mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
getOneOrNullResult should not throw an exception when having more than one result #6347
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @crtl on GitHub (Nov 22, 2019).
Originally assigned to: @Ocramius on GitHub.
Feature Request
Summary
When calling
AbstractQuery::getOneOrNullResultwhile having more than one result, results in an exception being thrown:Either the method name or the exception is wrong.
Why should an exception be thrown when I get more than one result?
@Ocramius commented on GitHub (Nov 22, 2019):
This is by design: a query that is supposed to retrieve one or zero results produced more results, and it should indeed throw (unexpected).