mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Too few parameters: the query defines n parameters but you only bound n-n #6476
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 @faso-dev on GitHub (May 28, 2020).
Sorry if this is not the right place to expose the problem.
When we use the queryBuilder and we call setParameter first then setParameters in second, it overwrites the data defined with the setParameter, from my point of view I think it's inconsistent, because normally it should merge them or add them to the parameter table if they do not exist.
The above example reproduces the error:
@Xesau commented on GitHub (Jul 8, 2020):
The API documentation specifically states that this is intended behaviour. I think in your case it's best to simply rewrite your code
@faso-dev commented on GitHub (Jul 8, 2020):
Yes I noticed. This is the solution that I finally opted for