mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
use different logic to decide whether mission type filter should be shown
This commit is contained in:
@@ -82,7 +82,7 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository
|
||||
return $qb;
|
||||
}
|
||||
|
||||
if (null !== $types && count($types) > 0) {
|
||||
if (null !== $types && count($types) > 0) {
|
||||
$qb->andWhere($qb->expr()->in('t.type', ':types'));
|
||||
|
||||
$qb->setParameter('types', $types);
|
||||
|
@@ -306,4 +306,28 @@ class SingleTaskRepository extends EntityRepository
|
||||
->add($qb->expr()->isNull('st.endDate'))
|
||||
->add($qb->expr()->isNull('st.warningInterval'));
|
||||
}
|
||||
|
||||
public function countByDistinctTypes()
|
||||
{
|
||||
$qb = $this->createQueryBuilder('st')
|
||||
->select('COUNT(DISTINCT st.type)');
|
||||
|
||||
$this->buildQuery($qb, []);
|
||||
|
||||
return (int) $qb
|
||||
->getQuery()
|
||||
->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function findAllTasktypes()
|
||||
{
|
||||
$qb = $this->createQueryBuilder('st')
|
||||
->select('DISTINCT st.type');
|
||||
|
||||
$this->buildQuery($qb, []);
|
||||
|
||||
return $qb
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user