fix error when querying with type

This commit is contained in:
Julien Fastré 2018-08-29 23:50:36 +02:00
parent a69b2d7e40
commit fb2ea549b9

View File

@ -128,9 +128,11 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository
$qb->setParameter('scope', $params['scope']);
}
if (\array_key_exists('types', $params)) {
$qb->andWhere($qb->expr()->in('st.type', ':types'));
$qb->setParameter('types', $params['types']);
if (\array_key_exists('types', $params) && $params['types'] !== NULL) {
if (count($params['types']) > 0) {
$qb->andWhere($qb->expr()->in('st.type', ':types'));
$qb->setParameter('types', $params['types']);
}
}
if (\array_key_exists('date_status', $params) and !empty($params['date_status'])) {