mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
add counter for tasks
This commit is contained in:
@@ -48,7 +48,7 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository
|
||||
* @param User $currentUser
|
||||
* @return int
|
||||
*/
|
||||
public function countByParameters($params, User $currentUser)
|
||||
public function countByParameters($params, User $currentUser = null)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('st')
|
||||
->select('COUNT(st)');
|
||||
@@ -97,9 +97,11 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
protected function buildQuery(QueryBuilder $qb, $params, User $currentUser)
|
||||
protected function buildQuery(QueryBuilder $qb, $params, User $currentUser = null)
|
||||
{
|
||||
$this->buildACLQuery($qb, $currentUser);
|
||||
if (NULL !== $currentUser) {
|
||||
$this->buildACLQuery($qb, $currentUser);
|
||||
}
|
||||
|
||||
if (\array_key_exists('person', $params) and !empty($params['person'])) {
|
||||
$qb->andWhere($qb->expr()->eq('st.person', ':person'));
|
||||
|
Reference in New Issue
Block a user