Hi,

I'm trying to get REGEXP working with createQueryBuilder (Doctrine2)
without success !

I tried this :

    $Em =  $this->get('doctrine')->getEntityManager('DB');
    $Results = $Em->createQueryBuilder()
        ->select('art')
        ->from('MyBundle:DBArticle', 'art')
        ->setParameter('RRRTRegexp', '^R[R|T]-[0-9]+$')
        ->where('art.refInterne REGEXP :RRRTRegexp')
        ->getQuery()
        ->getResult();

And this :

    $Em =  $this->get('doctrine')->getEntityManager('DB');
    $Results = $Em->createQueryBuilder()
        ->select('art')
        ->from('MyBundle:DBArticle', 'art')
        ->setParameter('RRRTRegexp', '^R[R|T]-[0-9]+$')
        ->where(new Doctrine\ORM\Query\Expr
\Comparison('meta.refInterne', 'REGEXP', '?RRRTRegexp'))
        ->getQuery()
        ->getResult();

But unfortunately I always get the same error :
Error: Expected =, <, <=, <>, >, >=, !=, got 'REGEXP'

Any idea ?

Thanks for your help !

Caroline.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to