0

How does one filter a Doctrine collection using a row constructor similar to what can be done with SQL such as SELECT whatever FROM t WHERE (col1, col2) IN ((val1a, val2a), (val1b, val2b), ...);?

user1032531
  • 24,767
  • 68
  • 217
  • 387
  • Probably using the QueryBuilders option to [build Expressions](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/query-builder.html#building-expressions), possibly with [this extension](https://github.com/beberlei/DoctrineExtensions) also installed. Dunno, haven't tried. What you found thus far that you can add to the question? – rkeet Jul 04 '19 at 14:16
  • @rkeet I used a workaround using `andX` and `orX` and found using `...` came in very handy. Regardless of whether I will use [this extension](https://github.com/beberlei/DoctrineExtensions) for this need, I never knew about that extension, and I will definitely investigate for other needs. Thanks! – user1032531 Jul 06 '19 at 13:07
  • You're welcome. Would be nice if you could provide a row constructor example as an answer when you figure that out though. Would like a tag when you do, can think of a few possible use cases in current projects for that, so would like to see an approach of how to. – rkeet Jul 07 '19 at 14:47

0 Answers0