PHP-document-Left-join-ON-condition和document中的其他条件语法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP-document-Left-join-ON-condition和document中的其他条件语法相关的知识,希望对你有一定的参考价值。

In SQL I can get this by adding AND to the join

LEFT JOIN installations i ON a.id = i.app AND i.page = :page
This way I get the installation info for an app that has an installation on the page, but I get null values on the columns for app's that have installations on other pages or not at all.

Is there a way to do this in Doctrine or am I better off just getting all the installations for each application and then checking against the found page with php?

##########################################################################

See function leftJoin in doc: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/query-builder.html#high-level-api-methods
  1. ->leftJoin('a.installations', 'i', 'WITH', 'i.page = :page')
  2. ->setParameter('page', $page)

以上是关于PHP-document-Left-join-ON-condition和document中的其他条件语法的主要内容,如果未能解决你的问题,请参考以下文章