I'm using querybuilder in my Symfony project to index all my person entities using several parameters like firstname, lastname, adress...
Each person can have 3 firstnames maximum. I'm using select2 in my form to allow the user to write several firstnames in the same inputfield.
Everything is working except the fact that if I'm typing an accented character in the field (like Rémy for example) I got the following error :
[Syntax Error] line 0, col 730: Error: Expected end of string, got 'é'
I tried everything but I cant find the error, here's the code in my PersonRepository which manages the firstname parameter:
if (!empty($firstNames)) {
$orConditions = $qb->expr()->orX();
foreach ($firstNames as $firstName) {
$orConditions->add(
$qb->expr()->like('LOWER(ip.firstName)', ':firstName' . $firstName)
);
$qb->setParameter(':firstName' . $firstName, '%' . mb_strtolower($firstName, 'UTF-8') . '%');
}
$qb->andWhere($orConditions);
}
Can you help me guys?