Arbitrary Join count walkers solution
Possible solution for Arbitrary Join problem in pagination count walkers: https://groups.google.com/forum/#!topic/doctrine-user/rpPYCDNKOU8 Added a condition to test query component against SelectStatement from clause
This commit is contained in:
parent
089cca636e
commit
114bd2435f
@ -57,7 +57,16 @@ class CountWalker extends TreeWalkerAdapter
|
|||||||
&& $qComp['nestingLevel'] == 0
|
&& $qComp['nestingLevel'] == 0
|
||||||
;
|
;
|
||||||
if ($isParent) {
|
if ($isParent) {
|
||||||
$rootComponents[] = array($dqlAlias => $qComp);
|
foreach($AST->fromClause->identificationVariableDeclarations as $identificationVariableDeclaration) {
|
||||||
|
$isRoot = $identificationVariableDeclaration->rangeVariableDeclaration
|
||||||
|
&& $identificationVariableDeclaration->rangeVariableDeclaration->aliasIdentificationVariable == $dqlAlias
|
||||||
|
&& $identificationVariableDeclaration->rangeVariableDeclaration->isRoot
|
||||||
|
;
|
||||||
|
if ($isRoot) {
|
||||||
|
$rootComponents[] = array($dqlAlias => $qComp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($rootComponents) > 1) {
|
if (count($rootComponents) > 1) {
|
||||||
|
@ -78,7 +78,16 @@ class WhereInWalker extends TreeWalkerAdapter
|
|||||||
&& $qComp['nestingLevel'] == 0
|
&& $qComp['nestingLevel'] == 0
|
||||||
;
|
;
|
||||||
if ($isParent) {
|
if ($isParent) {
|
||||||
$rootComponents[] = array($dqlAlias => $qComp);
|
foreach($AST->fromClause->identificationVariableDeclarations as $identificationVariableDeclaration) {
|
||||||
|
$isRoot = $identificationVariableDeclaration->rangeVariableDeclaration
|
||||||
|
&& $identificationVariableDeclaration->rangeVariableDeclaration->aliasIdentificationVariable == $dqlAlias
|
||||||
|
&& $identificationVariableDeclaration->rangeVariableDeclaration->isRoot
|
||||||
|
;
|
||||||
|
if ($isRoot) {
|
||||||
|
$rootComponents[] = array($dqlAlias => $qComp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($rootComponents) > 1) {
|
if (count($rootComponents) > 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user