mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-03 20:49:41 +00:00
Add pagination support to Audit Trail listing
- Added `countByCriteria` method in `AuditTrailRepository` to retrieve the total count of records based on criteria. - Injected `PaginatorFactoryInterface` into `AuditTrailSearchController` and updated the controller to handle pagination logic. - Updated the `list.html.twig` template to render the pagination controls using `chill_pagination`.
This commit is contained in:
@@ -75,6 +75,16 @@ class AuditTrailRepository extends ServiceEntityRepository
|
||||
->getQuery()->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{subjects?: list<Subject>, from_date?: \DateTimeImmutable, to_date?: \DateTimeImmutable, by_users?: list<User>} $criteria
|
||||
*/
|
||||
public function countByCriteria(array $criteria): int
|
||||
{
|
||||
return $this->buildByCriteriaQuery($criteria)
|
||||
->select('COUNT(audit)')
|
||||
->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{subjects?: list<Subject>, from_date?: \DateTimeImmutable, to_date?: \DateTimeImmutable, by_users?: list<User>} $criteria
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user