Skip to content

Commit

Permalink
Remove old InExpression workaround
Browse files Browse the repository at this point in the history
This was relevant for Doctrine ORM < 2.2, but paginator now requires ~2.4
  • Loading branch information
ostrolucky authored Aug 2, 2018
1 parent 72dacb4 commit 26f5246
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,9 @@ public function walkSelectStatement(SelectStatement $AST)
$count = $this->_getQuery()->getHint(self::HINT_PAGINATOR_ID_COUNT);

if ($count > 0) {
// in new doctrine 2.2 version theres a different expression
if (property_exists('Doctrine\ORM\Query\AST\InExpression', 'expression')) {
$arithmeticExpression = new ArithmeticExpression();
$arithmeticExpression->simpleArithmeticExpression = new SimpleArithmeticExpression(
array($pathExpression)
);
$expression = new InExpression($arithmeticExpression);
} else {
$expression = new InExpression($pathExpression);
}
$arithmeticExpression = new ArithmeticExpression();
$arithmeticExpression->simpleArithmeticExpression = new SimpleArithmeticExpression(array($pathExpression));
$expression = new InExpression($arithmeticExpression);
$ns = self::PAGINATOR_ID_ALIAS;

for ($i = 1; $i <= $count; $i++) {
Expand Down

0 comments on commit 26f5246

Please sign in to comment.