I'm having an issue when using bind parameters in my DQL statement.
I've created a JSONB
DBAL data type and a FunctionNode called JSON_CONTAINS_ANY()
function. The final query that I want is:
SELECT * from Cache where content->'status' ?| ['started','inprogress'];
My DQL statement looks as follow:
$dql = "SELECT e FROM Entity e WHERE JSON_CONTAINS_ANY(content, 'status', :statusList";
$dql->setParameter('statusList',$statusList, Jsonb::JSONB);
Question:
The problem is the the ?|
operator gets treated as a parameter expansion index and screws up my queries. Any ideas on how to handle this?