1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Merge branch 'DDC-2437'

This commit is contained in:
Benjamin Eberlei 2013-05-09 11:03:21 +02:00
commit 86277def7e
2 changed files with 15 additions and 2 deletions

View File

@ -139,7 +139,7 @@ class Join
{ {
return strtoupper($this->joinType) . ' JOIN ' . $this->join return strtoupper($this->joinType) . ' JOIN ' . $this->join
. ($this->alias ? ' ' . $this->alias : '') . ($this->alias ? ' ' . $this->alias : '')
. ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : '') . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '')
. ($this->indexBy ? ' INDEX BY ' . $this->indexBy : ''); . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : '');
} }
} }

View File

@ -142,6 +142,19 @@ class QueryBuilderTest extends \Doctrine\Tests\OrmTestCase
); );
} }
public function testComplexInnerJoinWithIndexBy()
{
$qb = $this->_em->createQueryBuilder()
->select('u', 'a')
->from('Doctrine\Tests\Models\CMS\CmsUser', 'u')
->innerJoin('u.articles', 'a', 'ON', 'u.id = a.author_id', 'a.name');
$this->assertValidQueryBuilder(
$qb,
'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a INDEX BY a.name ON u.id = a.author_id'
);
}
public function testLeftJoin() public function testLeftJoin()
{ {
$qb = $this->_em->createQueryBuilder() $qb = $this->_em->createQueryBuilder()