Regex with Doctrine 2 query builder?

前端 未结 4 1263
故里飘歌
故里飘歌 2020-12-10 12:38

As per the title, how would one match on a regular expression with the Doctrine 2 query builder? Basically I\'m trying to generate unique slugs.

Here is my current

4条回答
  •  抹茶落季
    2020-12-10 13:18

    I did like this

     $query->andWhere('REGEXP(r.status, :text) = 1')
           ->orWhere('REGEXP(r.comment, :text) = 1')
           ->setParameter('text',MY REGULAR EXP);
    

提交回复
热议问题