Doctrine 2.0 DQL concat参数问题

时间:2011-02-10 18:31:31

标签: doctrine dql

这是我的代码:

$query = $this->em->createQuery("select t.name,(select count(v) from Entity\Vacancy v where v.tags like '%t.name%') as weight from Entity\Tag t");

问题:

  带引号的字符串中的

不会被值替换;

在sql格式中,一切正常:

select tag.*,(select count(*) from vacancy where vacancy.tags like CONCAT('%',tag.name,'%')) as weight from tag

我尝试使用CONCAT(dql参数),但在LIKE解析器只等待一个字符串后,解析器抛出错误。

有办法吗?

0 个答案:

没有答案
相关问题