1
0
mirror of synced 2025-01-17 22:11:41 +03:00

small refactory

This commit is contained in:
Fabio B. Silva 2012-07-21 18:07:56 -03:00
parent b19e4a6440
commit af2f556fd3
2 changed files with 5 additions and 8 deletions

View File

@ -82,7 +82,7 @@ class SqlWalker implements TreeWalker
*
* @var integer
*/
private $newObjectCounter;
private $newObjectCounter = 0;
/**
* @var ParserResult
@ -1409,15 +1409,12 @@ class SqlWalker implements TreeWalker
$objIndex = $this->newObjectCounter ++;
foreach ($newObjectExpression->args as $argIndex => $e) {
$resultAlias = $this->scalarResultCounter++;
$columnAlias = $this->getSQLColumnAlias('sclr') . $resultAlias;
$resultAliasMap = $this->scalarResultAliasMap;
$resultAlias = $this->scalarResultCounter++;
$columnAlias = $this->getSQLColumnAlias('sclr') . $resultAlias;
switch (true) {
case $e instanceof AST\NewObjectExpression:
$sqlSelectExpressions[] = $e->dispatch($this);
break;
default:

View File

@ -141,7 +141,7 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
new Doctrine\Tests\Models\CMS\CmsUserDTO(
u.name,
e.email,
new Doctrine\Tests\Models\CMS\CmsUserDTO(
new Doctrine\Tests\Models\CMS\CmsAddressDTO(
a.country,
a.city,
a.zip
@ -186,7 +186,7 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
JOIN
u.phonenumbers p
GROUP BY
u
u, e, a
ORDER BY
u.name";