2013-01-21 51 views
1

我需要一個緊急幫助,我會解釋我想要做什麼,然後我們已經有。預期的已知功能,得到'MD5'

需要做一個搜索這樣的:

//Project\MyBundle\Repository 

$query = $this->getEntityManager()->getRepository('ProjectMyBundle:Product')->createQueryBuilder('p') 
     ->where('MD5(p.id) = :id') 
     ->setParameter('id', $id) 
     ->getQuery() 
     ->getSingleResult(); 

我得到的MD5 id和具有搜索數據庫的MD5的ID。

當我做了搜索,我發現了,給了我以下錯誤:

[Syntax Error] line 0, col 51: Error: Expected known function, got 'MD5'

表明lib目錄下:

https://github.com/beberlei/DoctrineExtensions/blob/master/lib/DoctrineExtensions/Query/Mysql/Md5.php

但我已經把它的文件夾內,現在我需要知道它應該在哪裏。

我在Symfony的2.1.6

+0

你正在使用哪種DBS? – KingCrunch

+0

我在Symfony 2.1.6中使用Mysql,Doctrine 2.2 – dmonteiro

回答