Skip to content

Commit

Permalink
fix: fixed phpcr iterator on joins
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Oct 19, 2023
1 parent 005bfb7 commit 1bc05e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
}
},
"minMsi": 72,
"minCoveredMsi": 80
"minCoveredMsi": 79
}
7 changes: 7 additions & 0 deletions src/Doctrine/PhpCr/PagerIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Doctrine\ODM\PHPCR\Query\Builder\OperandFactory;
use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder;
use Doctrine\ODM\PHPCR\Query\Builder\SourceDocument;
use Doctrine\ODM\PHPCR\Query\Builder\SourceJoin;
use ReflectionMethod;
use Refugis\DoctrineExtra\ObjectIteratorInterface;
use Refugis\DoctrineExtra\ODM\PhpCr\IteratorTrait;
Expand Down Expand Up @@ -87,6 +88,12 @@ protected function getObjects(): array
$fromNode = $queryBuilder->getChildOfType(AbstractNode::NT_FROM);
assert($fromNode instanceof From);
$source = $fromNode->getChildOfType(AbstractNode::NT_SOURCE);
if ($source instanceof SourceJoin) {
$source = $source
->getChildOfType(AbstractNode::NT_SOURCE_JOIN_LEFT)
->getChildOfType(AbstractNode::NT_SOURCE);
}

assert($source instanceof SourceDocument);
$alias = $source->getAlias();

Expand Down

0 comments on commit 1bc05e0

Please sign in to comment.