Adding the ability to alias new object expressions
This commit is contained in:
parent
20c6bfd360
commit
85eac7200d
@ -1353,7 +1353,8 @@ class SqlWalker implements TreeWalker
|
||||
break;
|
||||
|
||||
case ($expr instanceof AST\NewObjectExpression):
|
||||
$sql .= $this->walkNewObject($expr);
|
||||
$resultAlias = $selectExpression->fieldIdentificationVariable ?: null;
|
||||
$sql .= $this->walkNewObject($expr,$resultAlias);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1519,10 +1520,10 @@ class SqlWalker implements TreeWalker
|
||||
*
|
||||
* @return string The SQL.
|
||||
*/
|
||||
public function walkNewObject($newObjectExpression)
|
||||
public function walkNewObject($newObjectExpression, $newObjectResultAlias=null)
|
||||
{
|
||||
$sqlSelectExpressions = array();
|
||||
$objIndex = $this->newObjectCounter++;
|
||||
$objIndex = $newObjectResultAlias?:$this->newObjectCounter++;
|
||||
|
||||
foreach ($newObjectExpression->args as $argIndex => $e) {
|
||||
$resultAlias = $this->scalarResultCounter++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user