mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add filtering by task type
This commit is contained in:
parent
145e099903
commit
7ae56a6747
@ -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']));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user