Skip to content

Commit f0f8303

Browse files
authored
Merge pull request #204 from ostrolucky/patch-1
Remove old InExpression workaround
2 parents 72dacb4 + 26f5246 commit f0f8303

File tree

1 file changed

+3
-10
lines changed
  • src/Knp/Component/Pager/Event/Subscriber/Paginate/Doctrine/ORM/Query

1 file changed

+3
-10
lines changed

src/Knp/Component/Pager/Event/Subscriber/Paginate/Doctrine/ORM/Query/WhereInWalker.php

+3-10
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,9 @@ public function walkSelectStatement(SelectStatement $AST)
9494
$count = $this->_getQuery()->getHint(self::HINT_PAGINATOR_ID_COUNT);
9595

9696
if ($count > 0) {
97-
// in new doctrine 2.2 version theres a different expression
98-
if (property_exists('Doctrine\ORM\Query\AST\InExpression', 'expression')) {
99-
$arithmeticExpression = new ArithmeticExpression();
100-
$arithmeticExpression->simpleArithmeticExpression = new SimpleArithmeticExpression(
101-
array($pathExpression)
102-
);
103-
$expression = new InExpression($arithmeticExpression);
104-
} else {
105-
$expression = new InExpression($pathExpression);
106-
}
97+
$arithmeticExpression = new ArithmeticExpression();
98+
$arithmeticExpression->simpleArithmeticExpression = new SimpleArithmeticExpression(array($pathExpression));
99+
$expression = new InExpression($arithmeticExpression);
107100
$ns = self::PAGINATOR_ID_ALIAS;
108101

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

0 commit comments

Comments
 (0)