PHP,Doctrine,使用不同的join";其中“;以及“;在“上”;


PHP, Doctrine, use join with different "where" and "on"

我有一个用于获取实体的自定义存储库。我想在查询中添加一个内部联接,以便根据链接的数据进行一些研究。但我需要做单独的ON和Where。如果我做这样的

$qb = $this->createQueryBuilder($this->talias)
      ->add('where', 'conditions')
      ->join('Repository:OtherEntity', 'c');

我使用->add定义的条件('here','conditions')将在连接ON:中转换

SELECT records FROM table1 alias INNER JOIN OtherTable c ON( conditions )

但我需要的结果是

SELECT records FROM table1 alias INNER JOIN OtherTable c ON( ONconditions ) WHERE conditions

怎么走?感谢

好的,解决了,只需要向连接方法添加额外的参数

$qb->join("Entity", 'prefix', 'WITH', 'conditions');