small refactory
This commit is contained in:
parent
b19e4a6440
commit
af2f556fd3
@ -82,7 +82,7 @@ class SqlWalker implements TreeWalker
|
|||||||
*
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
private $newObjectCounter;
|
private $newObjectCounter = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ParserResult
|
* @var ParserResult
|
||||||
@ -1409,15 +1409,12 @@ class SqlWalker implements TreeWalker
|
|||||||
$objIndex = $this->newObjectCounter ++;
|
$objIndex = $this->newObjectCounter ++;
|
||||||
foreach ($newObjectExpression->args as $argIndex => $e) {
|
foreach ($newObjectExpression->args as $argIndex => $e) {
|
||||||
|
|
||||||
$resultAlias = $this->scalarResultCounter++;
|
$resultAlias = $this->scalarResultCounter++;
|
||||||
$columnAlias = $this->getSQLColumnAlias('sclr') . $resultAlias;
|
$columnAlias = $this->getSQLColumnAlias('sclr') . $resultAlias;
|
||||||
$resultAliasMap = $this->scalarResultAliasMap;
|
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case $e instanceof AST\NewObjectExpression:
|
case $e instanceof AST\NewObjectExpression:
|
||||||
|
|
||||||
$sqlSelectExpressions[] = $e->dispatch($this);
|
$sqlSelectExpressions[] = $e->dispatch($this);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -141,7 +141,7 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
new Doctrine\Tests\Models\CMS\CmsUserDTO(
|
new Doctrine\Tests\Models\CMS\CmsUserDTO(
|
||||||
u.name,
|
u.name,
|
||||||
e.email,
|
e.email,
|
||||||
new Doctrine\Tests\Models\CMS\CmsUserDTO(
|
new Doctrine\Tests\Models\CMS\CmsAddressDTO(
|
||||||
a.country,
|
a.country,
|
||||||
a.city,
|
a.city,
|
||||||
a.zip
|
a.zip
|
||||||
@ -186,7 +186,7 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
JOIN
|
JOIN
|
||||||
u.phonenumbers p
|
u.phonenumbers p
|
||||||
GROUP BY
|
GROUP BY
|
||||||
u
|
u, e, a
|
||||||
ORDER BY
|
ORDER BY
|
||||||
u.name";
|
u.name";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user