All is in the title.
$qb->expr()->like('a.lieu', ':advertLieu');
->setParameter('advertLieu', $postedAdvert->getVille()->getName()."%")
This will check if in the a.lieu entry there is a substring starting with the advertLieu parameter.
I want the inverse , like this :
$qb->expr()->like(':advertLieu', '%a.lieu%',);
->setParameter('advertLieu', $postedAdvert->getVille()->getName())
So, check if ma database entry a.lieu is contained in the parameter advertLieu
I found this : MySQL: What is a reverse version of LIKE? but How can i implement this in my query builder ?
Update
I have a similar question :
If i have a collection of entity in my database and want to check if my parameter exist in this array like : $qb->expr()->in('u.ids', $id)
I mean check if u.ids contain $id. Is it possible ? Thanks