mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Native SQL: set types of multiple query parameters #5783
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 @avg0043 on GitHub (Nov 24, 2017).
I'm using NativeSQL and I need set an undefined number of parameters. My code:
I need to set the type of every query parameters but setParameters() function doesn't allow pass this types.
I see that setParameter() function of AbstractQuery (Doctrine class) allow pass this types, but I would like to use setParamaters() function because I have to pass an undefined number of paramaters...
How can I solve this? Thanks.
@mateuszsip commented on GitHub (Dec 3, 2017):
The way you use
setParametersis the old way.After https://github.com/doctrine/doctrine2/pull/360 (from 2012) you should define them using
Parameterobjects:@avg0043 commented on GitHub (Dec 4, 2017):
It works perfectly. Thanks!