DX: modernize controller for permissions groups and order them alphabetically

This commit is contained in:
2023-04-25 10:52:07 +02:00
parent 66dc027354
commit 0083842509
2 changed files with 61 additions and 119 deletions

View File

@@ -38,6 +38,19 @@ final class PermissionsGroupRepository implements ObjectRepository
return $this->repository->findAll();
}
/**
* @return list<PermissionsGroup>
*/
public function findAllOrderedAlphabetically(): array
{
$qb = $this->repository->createQueryBuilder('pg');
return $qb->select(['pg', 'pg.name AS HIDDEN sort_name'])
->orderBy('sort_name')
->getQuery()
->getResult();
}
/**
* @param mixed|null $limit
* @param mixed|null $offset