【发布时间】:2015-01-02 19:36:28
【问题描述】:
这就是我使用标准的方式:
$criteria = Criteria::create();
$criteria->andWhere($criteria->expr()->eq('author', /**/));
$criteria->orWhere($criteria->expr()->eq('author', /**/));
$criteria->orWhere($criteria->expr()->eq('author', /**/));
这会导致这个 sql 命令:
WHERE
(
(
t0.author_id = ?
OR t0.author_id = ?
)
OR t0.author_id = ?
)
如果我需要这个怎么办?
WHERE
(
(
t0.author_id = ?
OR t0.author_id = ?
OR t0.author_id = ?
)
)
有什么办法可以改变括号的关联吗?
【问题讨论】:
标签: symfony doctrine-orm