Commit 7ae56a67 authored by Julien Fastré's avatar Julien Fastré

add filtering by task type

parent 145e0999
......@@ -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']));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment