【发布时间】:2014-03-05 13:51:49
【问题描述】:
我用这个代码;
public function findConversation($users)
{
$qb = $this->createQueryBuilder("c");
$qb->leftJoin('c.users','u')
->andWhere($qb->expr()->in('u', $users))
->getQuery()
->getSingleResult();
}
但是,$qb->expr 方法报错;
ContextErrorException:可捕获的致命错误:bla bla 类的对象 转换为字符串 C:\xampp\htdocs\Symfony\vendor\doctrine\orm\lib\Doctrine\ORM\Query\Expr.php 第618行
哪种方法更容易用于数组的 where 条件?
【问题讨论】:
标签: php symfony doctrine-orm