mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
EntityRepository::findOneBy() should throw NonUniqueResultException #6512
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 @KouloukLeGrand on GitHub (Aug 6, 2020).
I have just read that a Query throws a NonUniqueResultException if Query::getOneOrNullResult() or Query::getSingleResult() is called and finds more than one matching result.
Do you think it is feasible? And if not, why?
@beberlei commented on GitHub (Sep 13, 2020):
That is the way we want the API to work, multiple results can lead to the risk of the wrong one being picked without developer noticing.