diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php index 3dbe9145c..1556753b6 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php @@ -27,7 +27,7 @@ class JsonbExistsInArray extends FunctionNode return sprintf( '%s ?? %s', $this->expr1->dispatch($sqlWalker), - $sqlWalker->walkInputParameter($this->expr2) + $this->expr2->dispatch($sqlWalker) ); } diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php new file mode 100644 index 000000000..67c41d3d9 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php @@ -0,0 +1,41 @@ +em = self::$container->get(EntityManagerInterface::class); + } + + public function testDQLFunctionWorks() + { + $result = $this->em + ->createQuery('SELECT JSONB_EXISTS_IN_ARRAY(u.attributes, :param) FROM ' . User::class . ' u') + ->setParameter('param', 'fr') + ->getResult(); + + $this->assertIsArray($result); + } +}