Permalink
Browse files

Merge pull request #22 from johan-pap/patch-1

Update addFilterCriteria to filter on integer type
  • Loading branch information...
mgiagnoni committed Sep 20, 2012
2 parents 23a16b8 + 73eda34 commit f484b94322ee1caf9e4faf4d2b2f16f8c486c2bb
Showing with 6 additions and 2 deletions.
  1. +6 −2 QueryBuilder/QueryBuilder.php
@@ -130,13 +130,17 @@ protected function addFilterCriteria($qb, $criteria)
$qb->andWhere(
$qb->expr()->eq($alias.'.'.$field, $value === 'on' ? 1 : 0)
);
-
- break;
+ break;
case 'entity':
$qb->andWhere(
$qb->expr()->eq($field.'.id', $value->getId())
);
break;
+ case 'integer':
+ $qb->andWhere(
+ $qb->expr()->eq($alias.'.'.$field, (int) $value)
+ );
+ break;
}
}
}

0 comments on commit f484b94

Please sign in to comment.