From c84099508f8d245f63f28ed44a53ff6cde8b1d0c Mon Sep 17 00:00:00 2001
From: Francisco Facioni <fran6co@gmail.com>
Date: Thu, 22 Nov 2012 09:59:44 -0300
Subject: [PATCH] added outer left join

---
 lib/Doctrine/ORM/Query/SqlWalker.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php
index e0e2b2e89..f2fcca37f 100644
--- a/lib/Doctrine/ORM/Query/SqlWalker.php
+++ b/lib/Doctrine/ORM/Query/SqlWalker.php
@@ -1033,7 +1033,7 @@ class SqlWalker implements TreeWalker
         switch (true) {
             case ($joinDeclaration instanceof \Doctrine\ORM\Query\AST\RangeVariableDeclaration):
                 $class = $this->em->getClassMetadata($joinDeclaration->abstractSchemaName);
-                $condExprConjunction = $class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT
+                $condExprConjunction = $class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER
                     ? ' AND '
                     : ' ON ';