diff --git a/draft/new-core/Query.php b/draft/new-core/Query.php index 16bbb1903..512d9b92c 100644 --- a/draft/new-core/Query.php +++ b/draft/new-core/Query.php @@ -876,7 +876,7 @@ class Doctrine_Query2 extends Doctrine_Hydrate2 implements Countable . $joinCondition; if ($relation instanceof Doctrine_Relation_Association_Self) { - $queryPart .= ' OR ' . $foreignTable . '.' . $table->getIdentifier() . ' = ' + $queryPart .= ' OR ' . $foreignAlias . '.' . $table->getIdentifier() . ' = ' . $assocAlias . '.' . $relation->getLocal(); } diff --git a/tests/Query/JoinTestCase.php b/tests/Query/JoinTestCase.php index 4ff321317..d60e6abc6 100644 --- a/tests/Query/JoinTestCase.php +++ b/tests/Query/JoinTestCase.php @@ -58,7 +58,7 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase } public function testRecordHydrationWorksWithDeeplyNestedStructures() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->select('c.*, c2.*, d.*') ->from('Record_Country c')->leftJoin('c.City c2')->leftJoin('c2.District d') @@ -77,7 +77,7 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase } public function testManyToManyJoinUsesProperTableAliases() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->select('u.name')->from('User u INNER JOIN u.Group g'); @@ -86,7 +86,7 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase public function testSelfReferentialAssociationJoinsAreSupported() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->select('e.name')->from('Entity e INNER JOIN e.Entity e2');