DataObject Listing condition IN array

According to the documentation of “Working with Objects via PHP API” I tried to set an IN condition for an DataObject listing like this:

$entries = new DataObject\Test\Listing();
$entries->setCondition("`oo_id` IN (:ids)", ["ids" => [123, 456, 789]]);

Because I was not getting any objects, I was checking my MySQL server logs and found this query executed:

SELECT object_test.o_id as o_id, `object_test`.`o_type` FROM `object_test` WHERE ((`oo_id` IN ('Array') AND  object_test.o_type IN ('object','folder')) AND object_test.o_published = 1) ORDER BY `title` ASC LIMIT 30

If you check the condition, you see oo_id IN (‘Array’), so I assume that there is a problem with setting the array of ids in the condition.

Is this a know issue or is this the expected behavior?

For the record: I’m using Pimcore Version: v5.7.1

Hi,
this is only possible since Pimcore 5.8, see https://github.com/pimcore/pimcore/pull/4265

BR
Christian

1 Like

Alright cool - thanks for your fast response! :+1:t3: