I have a couple of OR conditions - each consisting of 2 nested conditions.
One of the nested conditions is straight forward, but the other is actually an ‘addInCondition’.
Here is an example of one of the OR conditions:
$criteria->addCondition('(val1 = :key AND val2 IN :array)', 'OR');
$criteria->params[':key'] = $myValue;
This line produces an ‘Array to string conversion’ error.
$criteria->params[':array'] = $myArray;
The only way I can get it working is to convert the array to a list e.g. “(‘34’, ‘72’, ‘94’)” and then ‘hardcode’ the list into the code:
$criteria->addCondition('(val1 = :key AND val2 IN '.$myArrayList.')', 'OR');
But there should be a better (more secure) way.