Changed calling $from[0] to using reset($from)
changed usage $from[0] according suggestion from @Ocramius to use array reset function
This commit is contained in:
parent
d48be34696
commit
589d26fc5e
5 changed files with 10 additions and 5 deletions
|
@ -96,7 +96,8 @@ class CountOutputWalker extends SqlWalker
|
|||
throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction");
|
||||
}
|
||||
|
||||
$rootAlias = $from[0]->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$fromRoot = reset($from);
|
||||
$rootAlias = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$rootClass = $this->queryComponents[$rootAlias]['metadata'];
|
||||
$rootIdentifier = $rootClass->identifier;
|
||||
|
||||
|
|
|
@ -58,7 +58,8 @@ class CountWalker extends TreeWalkerAdapter
|
|||
throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction");
|
||||
}
|
||||
|
||||
$rootAlias = $from[0]->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$fromRoot = reset($from);
|
||||
$rootAlias = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$rootClass = $queryComponents[$rootAlias]['metadata'];
|
||||
$identifierFieldName = $rootClass->getSingleIdentifierFieldName();
|
||||
|
||||
|
|
|
@ -122,7 +122,8 @@ class LimitSubqueryOutputWalker extends SqlWalker
|
|||
throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction");
|
||||
}
|
||||
|
||||
$rootAlias = $from[0]->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$fromRoot = reset($from);
|
||||
$rootAlias = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$rootClass = $this->queryComponents[$rootAlias]['metadata'];
|
||||
$rootIdentifier = $rootClass->identifier;
|
||||
|
||||
|
|
|
@ -63,7 +63,8 @@ class LimitSubqueryWalker extends TreeWalkerAdapter
|
|||
$queryComponents = $this->_getQueryComponents();
|
||||
// Get the root entity and alias from the AST fromClause
|
||||
$from = $AST->fromClause->identificationVariableDeclarations;
|
||||
$rootAlias = $from[0]->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$fromRoot = reset($from);
|
||||
$rootAlias = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$rootClass = $queryComponents[$rootAlias]['metadata'];
|
||||
$selectExpressions = array();
|
||||
|
||||
|
|
|
@ -79,7 +79,8 @@ class WhereInWalker extends TreeWalkerAdapter
|
|||
throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction");
|
||||
}
|
||||
|
||||
$rootAlias = $from[0]->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$fromRoot = reset($from);
|
||||
$rootAlias = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
|
||||
$rootClass = $queryComponents[$rootAlias]['metadata'];
|
||||
$identifierFieldName = $rootClass->getSingleIdentifierFieldName();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue