Skip to content
Advertisement

Can someone suggest a way to do this query using Doctrine (QueryBuilder) with multiple “where” clause?

I’m new to the QueryBuilder and I’m trying to do a POST request (with a JSON) to retrieve some informations in my database.

I’m using array because each property can have several values. Here’s the JSON I’m currently sending :

Here’s my database :

The request I would like to have :

And what I have currently done in Symfony, doesn’t work the way I want it to :

My goal is to get this result :

My code isn’t working well, it doesn’t send any error but only return ID : 8.

I’m looking for a way to do the query that returns only the ID : 1, 2, 8 and 12.

Thanks a lot for your future answers.

P.S : I’m running Symfony 4.3.11.

Advertisement

Answer

With Doctrine you can do for exemple:

That should be a good start.

To continue:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement