diff --git a/Repository/SingleTaskRepository.php b/Repository/SingleTaskRepository.php index f2bbd06c3..02a5bda51 100644 --- a/Repository/SingleTaskRepository.php +++ b/Repository/SingleTaskRepository.php @@ -73,6 +73,7 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository * `ended`, `warning`, `current`, `not_started` ; * - `is_closed`: boolean. Indicate if the tasks must be closed (true) or * opened + * - `types`: string[] an array of task types * * @param type $params * @param User $currentUser @@ -134,7 +135,10 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository if (\array_key_exists('is_closed', $params)) { $qb->andWhere($this->buildIsClosed($qb, !$params['is_closed'])); } - + + if (\array_key_exists('types', $params) && count($params['types']) > 0) { + $qb->andWhere($qb->expr()->in('st.type', $params['types'])); + } }