Performing Join with Multiple Criteria in Propel 1.5

主宰稳场 提交于 2019-12-04 12:21:49

Propel 1.6 supports multiple criteria on joins with addJoinCondition(). If you update the Symfony plugin, or move to sfPropelORMPlugin, you can take advantage of that. The query can then be written like this:

return $this
  ->leftJoin('GroupMembership')
  ->addJoinCondition('GroupMembership', 'GroupMembership.GroupId = ?', $group->getId())
  ->where('GroupMembership.PersonId IS NULL');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!