Passing tuples and 2d array parameters #5958

Closed
opened 2026-01-22 15:23:09 +01:00 by admin · 2 comments
Owner

Originally created by @tszymanek on GitHub (Apr 24, 2018).

Originally assigned to: @Ocramius on GitHub.

I've got a similar issue to #6200 but regarding the DQL Parser.

I can't pass a tuple with f.i. (e.id, e.revision) in
$qb->expr()->in('(e.id, e.revision)', ':idRevision') 'cause it expects a T_CLOSE_PARENTHESIS but gets a comma.

Probably the evaluation of the parameter being an array of arrays won't work as well.
$idRevision = array([1001, 1], [1002, 1], [1003, 2])

Originally created by @tszymanek on GitHub (Apr 24, 2018). Originally assigned to: @Ocramius on GitHub. I've got a similar issue to #6200 but regarding the DQL Parser. I can't pass a tuple with f.i. `(e.id, e.revision)` in `$qb->expr()->in('(e.id, e.revision)', ':idRevision')` 'cause it expects a `T_CLOSE_PARENTHESIS` but gets a comma. Probably the evaluation of the parameter being an array of arrays won't work as well. `$idRevision = array([1001, 1], [1002, 1], [1003, 2])`
admin added the New FeatureCan't Fix labels 2026-01-22 15:23:09 +01:00
admin closed this issue 2026-01-22 15:23:09 +01:00
Author
Owner

@Ocramius commented on GitHub (Apr 24, 2018):

I can't pass a tuple with f.i. (e.id, e.revision) in
$qb->expr()->in('(e.id, e.revision)', ':idRevision') 'cause it expects a T_CLOSE_PARENTHESIS but gets a comma.

Indeed, in() works against a single field in DQL.

Probably the evaluation of the parameter being an array of arrays won't work as well.
$idRevision = array([1001, 1], [1002, 1], [1003, 2])

This is a limitation of the DBAL type system: it would require a new major version to re-design the type system to not rely on type strings, but rather a type DSL.

@Ocramius commented on GitHub (Apr 24, 2018): > I can't pass a tuple with f.i. `(e.id, e.revision)` in `$qb->expr()->in('(e.id, e.revision)', ':idRevision')` 'cause it expects a `T_CLOSE_PARENTHESIS` but gets a comma. Indeed, `in()` works against a single field in DQL. > Probably the evaluation of the parameter being an array of arrays won't work as well. `$idRevision = array([1001, 1], [1002, 1], [1003, 2])` This is a limitation of the DBAL type system: it would require a new major version to re-design the type system to not rely on type strings, but rather a type DSL.
Author
Owner

@Ocramius commented on GitHub (Apr 24, 2018):

Closing as can't fix here - not something that we can work on in the near future.

@Ocramius commented on GitHub (Apr 24, 2018): Closing as `can't fix` here - not something that we can work on in the near future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5958